Application of Spectrogram – Spectral Doppler Solution



In this homework, you will practice applying spectrogram to form an ultrasound Spectral Doppler image”.

Basically, the spectral Doppler in biomedical ultrasound is to perform time-frequency analysis (e.g., short time DFT or spectrogram, see Eq. (7.203) in the textbook) over the acquired Doppler data set. Below is a representative screen shot of Spectral Doppler.

  1. Please implement your own DFT function myDFT() and DFT shift function myDFTshift(). You may verify your myDFT() and myDFTshift() by MATLAB built in function fft() and fftshift(). Use myDFT() and my DFTshift() to verify the effect of time windowing – comparing rectangular and Bartlett windows given your own provided signals. Note that zero-padding on your own provided signals before you performs DFT are required. Note that you have to take care the sequence between zero-padding and windowing and comments the results obtained from the difference sequences. To speed up myDFT() execution, you may try to implement it in the matrix form.

  1. Given the Doppler data set, SpectralDopplerData.mat, write your own spectrogram function – myspectrogram() from scratch (see Fig. 7.34) to implement spectral Doppler as indicated in the above figure, i.e., time-frequency analysis over the provided Doppler data set. Note that You have to use the myDFT() and myDFTshift() developed in (a) in your

myspectrogram(), and have to show the Spectral Doppler with correct axes

(see the above figure).

Note that

  • Your own spectrogram function should have the following function definition.

[S, F, t] = myspectrogram(x, window, Noverlap, Nfft, Fs)

The input/output of this function resembles the MATLAB function spectrogram(). Generally, Nfft is larger than (i.e., zero padding is performed) or equal to the length of window. Please “doc” spectrogram() to see the details of input/output parameters.

    • You can convert the frequency (Doppler frequency shift) to velocity by v = FDoppler*lambda/2, where FDoppler: Doppler shift and lambda: wavelength of the applied ultrasound

    • Here the positive or negative sign of frequency, i.e., FDoppler, has its physical meaning, representing the direction of velocity; therefore, you have to show positive and negative frequency parts (i.e., positive and negative velocities) simultaneously.

    • Nfft: not smaller than 64

    • After load(‘SpectralDopplerData.mat’), there are three variables –

DopplerData, PRF (pulse repetition frequency, in Hz, which is equivalent to Fs), and lambda (ultrasound wavelength, in meter)

  1. Adjust the window length, window type (Hann, Hamming, Rectangular, or else. See also MATLAB functions – window(), hann(), hanning() and hamming()), and overlapping ratio (i.e., Noverlap/window length*100%) to see how the spectral Doppler changes. Describe and justify what you observe.

To simplify your comparison, remember to fix the other parameters while adjusting one certain parameter (explained in the class).

  1. Write a function to implement audio Doppler, that is, playing the Spectral Doppler by two-channel stereo audio. In audio Doppler, we send the signals representing the part of positive frequency to left channel and those representing the part of negative frequency to right channel. Details please find in the following figure. Please describe how your implement audio Doppler, and remember to hand in the audio Doppler as a wave (*.wav) file. Can you figure out or hear anything from the difference between left channel and right channel in audio Doppler?


  1. Please hand in your solution files to the LMS elearning system, including your word file of the detailed solutions, the associated Matlab codes, and all the related materials. It would be nice that you can put your codes with comments side by side along with your answer in the word file.

  1. Name your solution files “EE3660_HW5_StudentID.doc” and “EE3660_HW5_StudentID.m”, and archive them as a single zip file:

  1. The first line of your word or Matlab file should contain your name and some brief description, e.g., % EE 3660 王小明 u9612345 HW5 MM/DD/2017