what is the relation between π*radian/sample and Hz in frequency axis of wvtool for windowing?

204 views (last 30 days)
While using wvtool for windowing the frequency domain horizontal axis is represented in either π*radian/sample or Hz. I am unable to find the relation between then in order to convert from one to other.
For example the frequency domain of rectangular window of length 45 (rectiwin(45)) is giving the -3dB main-lobe width is repredented as 19.531 mHz (or) in normailized frequency as 0.039062 π*radian/sample.
I used 'freqz' function on rectangular window of length 45 to plot its frequency domain seperately. It is giving peak mainlobe maginitude as 33.0642502755069dB at sample 1 and the -3dB of it i.e. 30.1062744728910 (I considered it as approximately 30.0642502755069dB) at sample 11.
So how to convert this into mHz or π*radian/sample?
Also I can't find the how the frequency axis is normalized.

Accepted Answer

Paul
Paul on 24 Feb 2022
Very short answer: In discrete time* using the nomenclature of wvtool and freqz, "Hz" means cycles/sample (not cycles per sec). Here, a cycle is one trip around the unit circle. So 1 cycle / sample = 1 Hz = 2*pi rad / sample. Applying to the numbers in the Question from wvtool:
% 0.039062*pi (rad/sample) * 1 Hz / 2pi (rad/sample)
fHz = 0.039062*pi / (2*pi)
fHz = 0.0195
Convert to milli-Hz
fmHz = fHz*1000
fmHz = 19.5310
Or we can invent a new unit called pi-rad (or prad), which is what fvtool and freqz use for plotting, in which case 1 Hz = 2 prad/sample
fHz = 0.039062 /2
fHz = 0.0195
However, be careful with freqz, because freqz without output arguments (and an unspecified sample rate) will plot the angular frequency using prad/sample on the x-axis
freqz(rectwin(45))
but requesting the angular frequency as an output argument returns rad/sample, which we can see by calling freqz() using the default frequency points that only traverse the top half of the unit circle
[h,w] = freqz(rectwin(45),1,10000);
w(end) % should be ~pi rad/sample
ans = 3.1413
*discrete time in this context simply refers to sequences indexed by an integer w/o reference to any sampling of continuous signals.

More Answers (1)

Star Strider
Star Strider on 24 Feb 2022
The radians/sample notation is the normalised frequency. The highest frequency that can be uniquely represented in a sampled signal is the Nyquist frequency, equal to one-half the sampling frequency.
The relation between them is that π radians/sample is equivalent to the Nyquist frequency in Hz.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!