spLib
読み取り中…
検索中…
一致する文字列を見つけられません
fileio.h
[詳解]
1
4#ifndef SPLIB_FILEIO_H
5#define SPLIB_FILEIO_H
6
7#include <sp/spFile.h>
8
9#include <sp/sp.h>
10#include <sp/vector.h>
11#include <sp/matrix.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#if defined(MACOS)
18#pragma import on
19#endif
20
28 /*----@addtogroup fileioGroup----*/
29
30extern long dvreadfirst(spDVector vector, long shift, long length, int swap, int double_flag, FILE *fp);
31extern long dvreadsfirst(spDVector vector, long shift, long length, int swap, FILE *fp);
32extern long dvreaddfirst(spDVector vector, long shift, long length, int swap, FILE *fp);
33extern long dvreadframe(spDVector vector, long shift, long length, int swap, int double_flag, FILE *fp);
34extern long dvreadsframe(spDVector vector, long shift, long length, int swap, FILE *fp);
35extern long dvreaddframe(spDVector vector, long shift, long length, int swap, FILE *fp);
36extern long dvwriteframe(spDVector vector, long shift, long length, int swap, int double_flag, FILE *fp);
37extern long dvwritesframe(spDVector vector, long shift, long length, int swap, FILE *fp);
38extern long dvwritedframe(spDVector vector, long shift, long length, int swap, FILE *fp);
39
45extern spSVector xsvreadssignal(const char *filename, long headlen, int swap);
48extern spLVector xlvreadlsignal(const char *filename, long headlen, int swap);
51extern spFVector xfvreadfsignal(const char *filename, long headlen, int swap);
58extern spDVector xdvreaddsignal(const char *filename, long headlen, int swap);
59
66extern spDVector xdvreadssignal(const char *filename, long headlen, int swap);
73extern spDVector xdvreadlsignal(const char *filename, long headlen, int swap);
80extern spDVector xdvreadfsignal(const char *filename, long headlen, int swap);
81
84extern spBool svwritessignal(const char *filename, spSVector vector, int swap);
87extern spBool lvwritelsignal(const char *filename, spLVector vector, int swap);
90extern spBool fvwritefsignal(const char *filename, spFVector vector, int swap);
97extern spBool dvwritedsignal(const char *filename, spDVector vector, int swap);
105extern spBool dvwritessignal(const char *filename, spDVector vector, int swap);
112extern spBool dvwritelsignal(const char *filename, spDVector vector, int swap);
119extern spBool dvwritefsignal(const char *filename, spDVector vector, int swap);
120
123#define xsvreadsvector(filename, swap) xsvreadssignal((filename), 0, (swap))
126#define xlvreadlvector(filename, swap) xlvreadlsignal((filename), 0, (swap))
129#define xfvreadfvector(filename, swap) xfvreadfsignal((filename), 0, (swap))
135#define xdvreaddvector(filename, swap) xdvreaddsignal((filename), 0, (swap))
141#define xdvreadsvector(filename, swap) xdvreadssignal((filename), 0, (swap))
147#define xdvreadlvector(filename, swap) xdvreadlsignal((filename), 0, (swap))
153#define xdvreadfvector(filename, swap) xdvreadfsignal((filename), 0, (swap))
154
157#define svwritesvector(filename, vector, swap) svwritessignal(filename, vector, swap)
160#define lvwritelvector(filename, vector, swap) lvwritelsignal(filename, vector, swap)
163#define fvwritefvector(filename, vector, swap) fvwritefsignal(filename, vector, swap)
170#define dvwritedvector(filename, vector, swap) dvwritedsignal(filename, vector, swap)
177#define dvwritesvector(filename, vector, swap) dvwritessignal(filename, vector, swap)
184#define dvwritelvector(filename, vector, swap) dvwritelsignal(filename, vector, swap)
191#define dvwritefvector(filename, vector, swap) dvwritefsignal(filename, vector, swap)
192
196extern spSVectors xsvsreadsvectors(const char *filename, long num_vector, int swap);
197extern spLVectors xlvsreadlvectors(const char *filename, long num_vector, int swap);
198extern spFVectors xfvsreadfvectors(const char *filename, long num_vector, int swap);
199extern spDVectors xdvsreaddvectors(const char *filename, long num_vector, int swap);
200/* return: length of one vector */
201extern long svswritesvectors(const char *filename, spSVectors vecs, int swap);
202extern long lvswritelvectors(const char *filename, spLVectors vecs, int swap);
203extern long fvswritefvectors(const char *filename, spFVectors vecs, int swap);
204extern long dvswritedvectors(const char *filename, spDVectors vecs, int swap);
205
211extern spSMatrix xsmreadsmatrix(const char *filename, long ncol, int swap);
214extern spLMatrix xlmreadlmatrix(const char *filename, long ncol, int swap);
217extern spFMatrix xfmreadfmatrix(const char *filename, long ncol, int swap);
224extern spDMatrix xdmreaddmatrix(const char *filename, long ncol, int swap);
231extern spDMatrix xdmreadsmatrix(const char *filename, long ncol, int swap);
238extern spDMatrix xdmreadlmatrix(const char *filename, long ncol, int swap);
245extern spDMatrix xdmreadfmatrix(const char *filename, long ncol, int swap);
248extern spBool smwritesmatrix(const char *filename, spSMatrix mat, int swap);
251extern spBool lmwritelmatrix(const char *filename, spLMatrix mat, int swap);
254extern spBool fmwritefmatrix(const char *filename, spFMatrix mat, int swap);
261extern spBool dmwritedmatrix(const char *filename, spDMatrix mat, int swap);
268extern spBool dmwritesmatrix(const char *filename, spDMatrix mat, int swap);
275extern spBool dmwritelmatrix(const char *filename, spDMatrix mat, int swap);
282extern spBool dmwritefmatrix(const char *filename, spDMatrix mat, int swap);
283
287extern spSMatrices xsmsreadsmatrices(const char *filename, long nmat, long ncol, int swap);
288extern spLMatrices xlmsreadlmatrices(const char *filename, long nmat, long ncol, int swap);
289extern spFMatrices xfmsreadfmatrices(const char *filename, long nmat, long ncol, int swap);
290extern spDMatrices xdmsreaddmatrices(const char *filename, long nmat, long ncol, int swap);
291extern spDMatrices xdmsreadsmatrices(const char *filename, long nmat, long ncol, int swap);
292extern spDMatrices xdmsreadlmatrices(const char *filename, long nmat, long ncol, int swap);
293extern spDMatrices xdmsreadfmatrices(const char *filename, long nmat, long ncol, int swap);
294/* the sizes of all matrices must be the same. */
295extern spBool smswritesmatrices(const char *filename, spSMatrices xs, int swap);
296extern spBool lmswritelmatrices(const char *filename, spLMatrices xs, int swap);
297extern spBool fmswritefmatrices(const char *filename, spFMatrices xs, int swap);
298extern spBool dmswritedmatrices(const char *filename, spDMatrices xs, int swap);
299extern spBool dmswritesmatrices(const char *filename, spDMatrices xs, int swap);
300extern spBool dmswritelmatrices(const char *filename, spDMatrices xs, int swap);
301extern spBool dmswritefmatrices(const char *filename, spDMatrices xs, int swap);
302
308extern spBool svreadsvector_txt(const char *filename, spSVector vector);
311extern spBool lvreadlvector_txt(const char *filename, spLVector vector);
314extern spBool fvreadfvector_txt(const char *filename, spFVector vector);
320extern spBool dvreaddvector_txt(const char *filename, spDVector vector);
323extern spSVector xsvreadsvector_txt(const char *filename);
326extern spLVector xlvreadlvector_txt(const char *filename);
329extern spFVector xfvreadfvector_txt(const char *filename);
334extern spDVector xdvreaddvector_txt(const char *filename);
335
338extern spBool svreadcol_txt(const char *filename, int col, spSVector vector);
341extern spBool lvreadcol_txt(const char *filename, int col, spLVector vector);
344extern spBool fvreadcol_txt(const char *filename, int col, spFVector vector);
351extern spBool dvreadcol_txt(const char *filename, int col, spDVector vector);
354extern spSVector xsvreadcol_txt(const char *filename, int col);
357extern spLVector xlvreadcol_txt(const char *filename, int col);
360extern spFVector xfvreadcol_txt(const char *filename, int col);
366extern spDVector xdvreadcol_txt(const char *filename, int col);
367
370extern spBool svwritesvector_txt(const char *filename, spSVector vector);
373extern spBool lvwritelvector_txt(const char *filename, spLVector vector);
376extern spBool fvwritefvector_txt(const char *filename, spFVector vector);
382extern spBool dvwritedvector_txt(const char *filename, spDVector vector);
383
391extern float fvmaxamp(spFVector vec);
394extern double dvmaxamp(spDVector vec);
397extern float fvadjustamp(spFVector vec, float amp);
400extern double dvadjustamp(spDVector vec, double amp);
403extern float fvlimitamp(spFVector vec, float amp);
406extern double dvlimitamp(spDVector vec, double amp);
407
410extern spFVector xfvextractchannel(spFVector x, int channel, int num_channel);
413extern spDVector xdvextractchannel(spDVector x, int channel, int num_channel);
414
422extern void svdump(spSVector vec);
425extern void lvdump(spLVector vec);
428extern void fvdump(spFVector vec);
431extern void dvdump(spDVector vec);
432
435extern void svfdump(spSVector vec, FILE *fp);
438extern void lvfdump(spLVector vec, FILE *fp);
441extern void fvfdump(spFVector vec, FILE *fp);
444extern void dvfdump(spDVector vec, FILE *fp);
445
446/* real part only. must be NULL end */
450extern void svnfdump(FILE *fp, ...);
454extern void lvnfdump(FILE *fp, ...);
458extern void fvnfdump(FILE *fp, ...);
462extern void dvnfdump(FILE *fp, ...);
463
467extern void svsfdump(spSVectors vecs, FILE *fp);
468extern void lvsfdump(spLVectors vecs, FILE *fp);
469extern void fvsfdump(spFVectors vecs, FILE *fp);
470extern void dvsfdump(spDVectors vecs, FILE *fp);
471
477extern void smfdump(spSMatrix mat, FILE *fp);
480extern void lmfdump(spLMatrix mat, FILE *fp);
483extern void fmfdump(spFMatrix mat, FILE *fp);
486extern void dmfdump(spDMatrix mat, FILE *fp);
487
490#define smdump(mat) smfdump(mat, (stdout))
493#define lmdump(mat) lmfdump(mat, (stdout))
496#define fmdump(mat) fmfdump(mat, (stdout))
499#define dmdump(mat) dmfdump(mat, (stdout))
500
504/* spAudio library is required to use the following functions */
505extern spBool dvsupportaudiofile(const char *filename, const char *plugin_name);
506extern spDVector xdvreadaudiofileex(const char *filename, const char *plugin_name,
507 double *samp_freq, int *samp_bit, int *num_channel, double weight,
508 spDVectorCallbackFunc func, void *data); /* Version 0.9.1+ */
509extern spDVector xdvreadaudiofile(const char *filename, const char *plugin_name,
510 double *samp_freq, int *samp_bit, int *num_channel, double weight);
511extern long dvwriteaudiofileex(spDVector x, const char *filename, const char *plugin_name,
512 double samp_freq, int samp_bit, int num_channel, double weight,
513 spDVectorCallbackFunc func, void *data); /* Version 0.9.1+ */
514extern long dvwriteaudiofile(spDVector x, const char *filename, const char *plugin_name,
515 double samp_freq, int samp_bit, int num_channel, double weight);
516
517 /*----@addtogroup fileioGroup----*/
518
519#if defined(MACOS)
520#pragma import off
521#endif
522
523#if !defined(SP_DISABLE_ABBREVIATION)
524/* for backwards compatibility */
525#define xreadssignal xsvreadssignal
526#define xreaddsignal xdvreaddsignal
527#define writessignal svwritessignal
528#define writedsignal dvwritedsignal
529
530#define xreadsvector xsvreadsvector
531#define xreaddvector xdvreaddvector
532#define writesvector svwritesvector
533#define writedvector dvwritedvector
534
535#define xreadlmatrix xlmreadlmatrix
536#define xreaddmatrix xdmreaddmatrix
537#define writelmatrix lmwritelmatrix
538#define writedmatrix dmwritedmatrix
539
540#define readdvector_txt dvreaddvector_txt
541#define xreaddvector_txt xdvreaddvector_txt
542#define writedvector_txt dvwritedvector_txt
543#endif /* !defined(SP_DISABLE_ABBREVIATION) */
544
545#ifdef __cplusplus
546} /* Close scope of 'extern "C"' declaration */
547#endif
548
549#endif /* SPLIB_FILEIO_H */
int spBool
double型を扱うための行列型です.
Definition matrix.h:152
double型を扱うためのベクトル型です.
Definition vector.h:248
double型を扱うための行列型です.
Definition matrix.h:117
float型を扱うためのベクトル型です.
Definition vector.h:214
double型を扱うための行列型です.
Definition matrix.h:82
long型を扱うためのベクトル型です.
Definition vector.h:180
double型を扱うための行列型です.
Definition matrix.h:47
short型を扱うためのベクトル型です.
Definition vector.h:146