0
$\begingroup$

I have a signal sampled at 16000 Hz I need to convert the normalized frequency of Matlab 0.325 to radians/sec Hz and Discrete frequency. Can anyone explain this to me? And btw Matlab plots the normalized frequency as $\pi$ rads/sample. So we have to divide the normalized frequency with $\pi$?

$\endgroup$
1
2
$\begingroup$

The continuous-time frequency $\Omega$ and "discrete" frequency $\omega$ given a sampling period of $T_s$ is given by

$$\omega = \Omega T_s = 2{\pi}fT_s \space\text{rads/sample}$$

Where $-\pi \lt\omega\le\pi $ assuming double-sided spectrums.

It's important to note the units: the continuous frequency $\Omega$ is in rads/s, so multiplying by the sampling period gives you the unit of rads/sample.

If you rewrite the above expression using the sampling frequency $f_s$ you get

$$\omega = 2{\pi}\frac{f}{f_s} \space\text{rads/sample}$$

MATLAB divides this by $\pi$ so that we get a new set of normalized frequencies $\omega'$

$$\omega' = \frac{\omega}{\pi} = 2\frac{f}{f_s}$$

When you sample at a rate of $f_s$, your single-sided unaliased spectrum would be in the range of $[0, \frac{f_s}{2}]$. If you take this range and use the equations for $\omega$ and $\omega'$ you get the ranges

  1. $[0, \pi]$ for $\omega$
  2. $[0, 1]$ for $\omega'$

The second range is what MATLAB uses as the default when plotting discrete frequency responses. In order to report the frequency as "rads/sample" the factor of $\pi$ is re-introduced which is why you see the axis labeled as "x $\pi$ rads/sample". This convention is used to help you quickly identify frequency values as related to your sampling frequency $f_s$ as we'll see in some examples blow.

As an example, a normalized discrete frequency of 0.5 from MATLAB at your sample rate of 16 kHz gives you the continuous time frequency of

$$f = \frac{\omega'f_s}{2} = \frac{(0.5)16000}{2} = 4 \text{ kHz}$$

A value of 1 will yield

$$f = \frac{\omega'f_s}{2} = \frac{(1)16000}{2} = 8 \text{ kHz}$$

The latter is exactly the Nyquist frequency of your signal and gives us the analog to discrete domain frequency mappings we expect. You can find more information here.

$\endgroup$
5
  • $\begingroup$ besides the awful "All Arrays Begin at x(1)", I've never liked this convention of MATLAB. it's off by a factor of 2 (i.e. should be normalized to $f_\mathrm{s}$, also MATLAB does the indices to coefficients of powered terms in a polynomials backwards. $\endgroup$ – robert bristow-johnson Oct 14 '20 at 22:37
  • $\begingroup$ @robertbristow-johnson Yeah this also bothered me for the longest time! $\endgroup$ – Envidia Oct 14 '20 at 22:56
  • $\begingroup$ You never specify what f is in these equations. Also on top you say that the analog frequency is Ω but on bottom you say it is f. Sorry just desperately trying to understand. $\endgroup$ – Gerasimos Delivorias Oct 15 '20 at 12:40
  • $\begingroup$ @GerasimosDelivorias The continuous-time frequencies $\Omega$ and $f$ are related by $\Omega = 2{\pi}f$. The first is in rads/s and the second is in cycles/s, or Hz. $\endgroup$ – Envidia Oct 15 '20 at 14:56
  • $\begingroup$ Thank you very much. I really appreciate it! $\endgroup$ – Gerasimos Delivorias Oct 15 '20 at 18:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.