# How to plot the magnitude spectrum against its frequency (bode plot)?

1. ## How to plot the magnitude spectrum against its frequency (bode plot)?

Hi

I am new to study DSP, and I would like to ask the following questions:

I have a test wav file, i use wavread to read the file as well as getting its sampling frequency, however I don't know how to plot the wav in FFT, the annoying thing is the frequency axis, I already know the sampling frequency is 8kHz, but I have no idea how can I plot the magnitude spectrum against its frequency.

Hope someone can explain to me the steps.

Many thanks •

2. ## Plot a bode plot

Bode plots are both Magnitude and Phase Shift values vs. frequency.
Are you using MATLAB?there is very nice example howto use and plot FFT on base of Wolf number ( number of stains at the sun). •

3. ## Plot a bode plot

yes, i m using matlab, i just don't know how to get the right frequency axis. I only know the sampling frequency of the signal, and I capture only a 8ms duration of the signal using a 128 points hamming windows. •

4. ## Plot a bode plot

So, you have 8ms of data and you are sampling at 16kHz (128 points captured in 8ms).
The FFT resolution is then 125Hz and the highest frequency is 8kHz (16kHz/2, Nyquist theorem).
In matlab language: f=0:125:8000; is your frequency axis. Keep in mind that matlab will show both sides of your FFT, so you will need to half the FFT result length... 5. ## Plot a bode plot

I think I sort out understand your explainsion, because the highest frequency in the signal is 8kHz, this is why my sampling frequency is 16kHz, therefore the last point corresponding the highest (last) frequency component in my signal, and because my sampling frequency is 16kHz, and I have 128 points, so resolution is 125Hz. Am I explaining correctly?

I now have 3questions wanna ask you experts, as in this case, I have to use a filter to suppress the tonal interference, I used FIR1 but have no idea for the following terms:

1. What is tonal interference?

2.what is normalized frequency? How to calculate it?

3.When I use filter function in Matlab, how should I determine the order parameter please? --[[ ]]--