Spectral analysis in Octave

spectrum.m is a program for computing the Fourier spectrum of a 512-sample portion of a signal X at samples 15000 to 15511. To obtain the spectrum in a different position in the file, you'll need to change these numbers in the script, or add a line to get the position from user input.

For the calculation of the FFT, it uses the fft function, which is from the signal processing toolkit.

For example, to get the spectrum at around sample 15000 of joe.dat (the middle of the vowel [a] of “father”), type in Octave:


Enter the filename joe.dat

Assign X = In;



Next: Explanation of spectrum.m