Engineering Design NIDisk Betriebsanweisung Seite 30

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 34
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 29
SIGNAL/RTS APPLICATION NOTES
6 Application Note 11
1 5 9 2 6 10 3 7 11 4 8 12
Note that when displaying this matrix numerically, MATLAB will display the first row at the
top of the screen, as shown below. However, when displaying the same matrix as a
spectrogram, the first row (lowest frequency) will appear at the bottom of the graph. It
should not be necessary to rearrange the stored matrix; this is a difference in display
conventions.
1 2 3 4
5 6 7 8
9 10 11 12
Row-Column Dimensions
When importing into MATLAB, matrix dimensions are included in the FREAD command.
When importing into SIGNAL, matrix dimensions are supplied to the read command via user
queries. See the examples below.
Transferring Spectrogram Files from SIGNAL to MATLAB
Example: calculate the spectrogram of TWEET.1 in SIGNAL and store it as a SIGNAL-
header floating point file, then read this spectrogram into MATLAB. To unpack this file
correctly into a MATLAB array, you must know the number of FFT’s and the number of
points stored per FFT, and to display it you must also know its sample rate. These quantities
are displayed by the SIGNAL BD command as NTIM, NFRQ, and SRATE, respectively. See
the SPECTRO.M demo below to display the spectrogram matrix in MATLAB.
>R T 1 In SIGNAL
Filename: C:\SIGNAL\TWEET.1
>SET XFTLEN 256
>SET XFTSTP 100
>XFT T 1 1
>W FT 1
Filename: TWEET.FT
fid = fopen ('tweet.ft','rb'); In MATLAB
fseek(fid,1024,'bof');
A = fread (fid,[104,100],'float32'); % no. pts/FFT, no. FFT’s
Transferring Spectrogram Files from MATLAB to SIGNAL
Example: store a spectrogram file from MATLAB, then read it into SIGNAL. To read the
file into SIGNAL, you must know the number of FFT’s, time duration, and sample rate.
1. In MATLAB, write the matrix array A to the headerless floating point file RFILE:
fid = fopen ('rfile','wb');
fwrite (fid,A,'float32');
Seitenansicht 29
1 2 ... 25 26 27 28 29 30 31 32 33 34

Kommentare zu diesen Handbüchern

Keine Kommentare