Page 68 - Basics of MATLAB and Beyond
P. 68

the periodograms of the blocks, and averages the periodograms at each
                               frequency. This is a technique commonly used to reduce the variance
                               of the PSD. For example, we can compare the variance of the above
                               estimate to that of a single periodogram by telling spectrum to use a
                               blocklength equal to the length of the signal:






                               spectrum(y,8192)







                               You can also specify windows to reduce spectral leakage, sampling fre-
                               quencies to get correct frequency scales and overlapping blocks. If you
                               are interested in PSD estimation, the Signal Processing toolbox contains
                               other methods of PSD estimation including Welch’s method, MUSIC,
                               maximum entropy and multitaper. matlab also provides a graphical
                               user interface for spectral estimation as part of its interactive signal pro-
                               cessing environment sptool. The System Identification toolbox also con-
                               tains algorithms for PSD estimation (type iddemo and choose option 5
                               for a demonstration).

                               19    Sounds in MATLAB

                               matlab can send data to your computer’s speaker, allowing you to visu-
                               ally manipulate your data, and listen to it at the same time. A digitised
                               recording of an interesting sound is contained in the mat-file chirp.mat.
                               Load this data, do a plot, and listen to the sound by typing:




                               load chirp
                               plot(y)
                               sound(y)




                               The volume of the sound can be controlled from within matlab using
                               the soundsc function and supplying an upper and lower limit. Or if
                               you wish, you can use your computer’s system software to control the
                               volume. On UNIX the volume of the sound can be controlled with the




                               c   2000 by CRC Press LLC
   63   64   65   66   67   68   69   70   71   72   73