
Exchanging Data Files between SIGNAL and MATLAB
Application Note 11 7
2. In SIGNAL, read the floating point (/F) file RFILE into FT buffer 1. The command queries
establish the FT buffer dimensions and time base.
>R FT 1 /B /F
Sample rate: 25000
Time range (msec): 250
No. time steps: 100
Filename: RFILE
Exporting RTS files into MATLAB
The RTS writes and reads only time files. It can write either SIGNAL-header or headerless
files, but can read only SIGNAL-header files. Therefore the RTS can export time signals to
MATLAB as SIGNAL-header time files but cannot import them from MATLAB.
MATLAB Demo Files
SIGNAL provides two MATLAB M-files in \demos which demonstrate some of the above
techniques. TFILE.M demonstrates file import and export commands, and SPECTRO.M
displays two- and three-dimensional spectrograms in MATLAB, based on a spectrogram file
imported from SIGNAL. These demos use three sound files provided in the \sysdata
directory: tweet.1, tweet.f, and tweet.ft. SPECTRO could be the basis for a general
spectrogram display routine. Note: these files were tested with MATLAB version 5.2.
MATLAB Sound Processing Functions
MATLAB version 5.2 offers several sound processing functions, notably the ability to read
and write Wave files (WAVREAD and WAVWRITE) and to play sampled sound data
through the PC speaker (SOUND and SOUNDSC). These functions have the following
limitations.
1. WAVREAD and WAVWRITE handle data only between -1 and +1, truncating any sample
values outside this range. Because SIGNAL's acquisition range is
±10 Volts, these functions
are not recommended for data exchange with SIGNAL.
2. Like all software that plays through the PC's built-in "sound card" hardware, SOUND and
SOUNDSC are restricted to the available hardware sample rates, namely 44100 Hz, 22050
Hz, etc. To accommodate source signals of any sample rate, these functions automatically
resample the playback signal mathematically to the nearest available hardware rate. This will
usually introduce significant distortion, and so these functions are recommended only for
signals with PC-compatible native sample rates.
Kommentare zu diesen Handbüchern