The `faust2octave` script, distributed with FAUST, executes
shell commands similar to the `faust2plot` script mentioned
above, then executes the generated program to write a matlab input
file, and finally loads the file in Octave. The result is typically as
if the following commands were typed for the above example:

> faust -a matlabplot.cpp cpgrir.dsp -o cpgrir.cpp > g++ -O3 cpgrir.cpp -o cpgrir > cpgrir -n 600 > cpgrir.m > octave --persist cpgrir.mIn Octave, the variable

In Octave, an overlay of all output signals can be plotted by the command

octave:1> plot(faustout);Very often in signal processing we need to see the spectrum of the signal:

octave:1> plot(20*log10(abs(fft(faustout,1024))(1:512,:)));In this example, the signal is zero-padded out to 1024 samples, a Fast Fourier Transform (FFT) is performed, the first 512 samples are selected, the absolute value is taken, followed by conversion to dB, and finally this dB spectral magnitude is plotted. If there are multiple output signals, their dB-magnitude spectra are all plotted overlaid.

Download aspf.pdf

[Comment on this page via email]

Copyright ©

Center for Computer Research in Music and Acoustics (CCRMA), Stanford University