0
$\begingroup$

Let's say we want to generate a signal in MATLAB, using sin, representing the A-major chord (440 Hz, 550 Hz, 660 Hz, each with amplitude 0.1).

I know we have to use the normalized angular frequency. But I don't understand why? Could someone kindly expalin this to me, please.

$\endgroup$
1
$\begingroup$

We use normalized frequency units in DSP mainly for convenience-- most DSP textbooks are written this way so that the theory can be presented in terms of essentially unitless quantities.

For instance, if you are talking about a sampled signal $x[n] = x(nT_s)$, where $T_s$ is the sample period, the discrete-time signal $x[n]$ now has no notion of time associated with it, because $n$ is an integer. Consequently, there can be no notion of "physical" frequency, in Hz or rad/s.

Practically speaking, what this means is that you end up having to "translate" frequencies back and forth, i.e. find out what cutoff frequency you want your filter to be in Hz, make sure your sample rate is greater than twice that, then find out what that frequency is in normalized units.

For your original question, you just need to make sure that your sample rate is high enough to capture all the frequency content. Your sample rate would need to be greater than $2\times 660 \textrm{ Hz}$ at a minimum, but practically you may want to make it even higher for a number of other reasons.

In MATLAB your script would look something like this:

clear
clc
close all

Fs = 2*700; % set sample rate higher if needed
Ts = 1/Fs;
t_duration = 1; % for now, one second of audio. can change if needed
t = 0:Ts:t_duration;
A = 0.1;
signal = A*sin(2*pi*440*t) + A*sin(2*pi*550*t) + A*sin(2*pi*660*t);

Note that you might want to change the phases of the individual sine terms to get the effect you are looking for.

EDIT 1:

Note that in the example code $t = nT_s = n/F_s$, therefore the argument to the sin function is: $$ 2\pi f t = \left( 2\pi\frac{ f}{F_s} \right) n $$

EDIT 2:

Technically, in your example if all you are doing is generating a signal, you don't need to explicitly use normalized frequency; you just need to make sure that your sample rate is high enough. This answer was touching on the broader question of, in general, why someone would want to.

$\endgroup$
  • $\begingroup$ Normalized angular frequency is 2*pi*f / fs, right? Then in the code you did not use the normalized angular frequency. Or maybe I don't understand the logic. $\endgroup$ – Niousha Nov 20 '18 at 19:14
  • $\begingroup$ @Niousha I've added more explanatory comments $\endgroup$ – Robert L. Nov 20 '18 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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