Digital Signal Processing Using MATLAB and Wavelets

Chapter 10: Applications

This chapter presents several applications in MATLAB. First, it covers working with sound and images, including how to show sound as a frequency-domain graph. Other applications focus on the discrete wavelet transform, and how to design an FIR filter. This chapter also includes a set of programs to recursively solve a Su Doku puzzle. Finally, it ends with an example on compression.

10.1 Examples Working with Sound

MATLAB can read and write sound files in the . wav format. Of course, the computer must have a microphone attached. Unfortunately, at the time of this writing, some of the .wav features are only available on the Microsoft Windows version of MATLAB. The example below records 16,000 samples at 8000 samples/second, as double values. A little math reveals that this records for two seconds. After recording, the code plays the sound back.

    % record from the microphone    x = wavrecord(16000, 8000, 'double');    % play it back    wavplay(x)

Running the above code produces an odd-sounding result. Since we did not specify the sampling rate, MATLAB chose one for us: 11,025 Hz (according to the help function). We next specify the correct sampling rate.

    % play it back at the right sampling rate    wavplay(x, 8000)

What do you observe when the playback sampling rate (given as the second parameter) is less than the sampling rate used in the recording? What...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Analog-to-Digital Converters
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.