# Drawing a frequency spectrum help

Status
Not open for further replies.

#### shosh

##### Member
I have a pretty simple question. when given an analog signal, how do you draw the resulting spectrum?

lets say we're given a signal of
x(t) = cos (400*pi*t)

how do you draw the resulting spectrum?

#### MrAl

##### Well-Known Member
Hi,

For this simple example w is equal to 400*pi so you would draw a single straight line from 0 to the amplitude (which is 1) at the position on the x axis of 400*pi if you want to plot w vs amplitude. If you want frequency f vs amplitude then convert w to frequency first with:
f=w/(2*pi)
and then plot it in the same manner.

It would look like:

______________|____________

where that one vertical line represents the amplitude at either w or f.

#### dougy83

##### Well-Known Member
Well, in general, [LATEX]x(t)=\cos(2\pi f_c t)[/LATEX] where $f_c$ is the frequency. So the frequency spectrum for x(t) in this case is a peak of 0.5 at $f_c = \pm 200 Hz$.

#### shosh

##### Member
so where does sampling come into play? specifically i want to undersample it (just because).
lets say i undersample the signal using a sampling rate of 300, what would be the resulting graph

#### dougy83

##### Well-Known Member
>> specifically i want to undersample it (just because).
>> lets say i undersample the signal using a sampling rate of 300, what would be the resulting graph
The spectrum will fold about fs/2 (Nyquist freq.) and you'll have a 100 Hz peak.

EDIT: Read this for starters: https://en.wikipedia.org/wiki/Aliasing

Last edited:

#### shosh

##### Member
ok, so if a drew a graph of up to +/- 3fs, id get a peak at -600, -400, -200, 200, 400 , 600. then i get some other peaks at -300, -100, 100 and 300, which are my aliasing components. is that correct?

#### dougy83

##### Well-Known Member
ok, so if a drew a graph of up to +/- 3fs, id get a peak at -600, -400, -200, 200, 400 , 600. then i get some other peaks at -300, -100, 100 and 300, which are my aliasing components. is that correct?
No. Have another look at the wiki page. The folding is about fs/2, repeated every fs, not every fs/2 as it looks like you have done.

Another page you should read: https://en.wikipedia.org/wiki/Nyquist–Shannon_sampling_theorem

Of particular note is the Poisson summation formula shown in the above page, which tells you exactly which frequencies there will be:
$X_s(f)\equiv\displaystyle\sum_{k=-\infty}^\infty X(f - k f_s)$

Last edited:

#### MrAl

##### Well-Known Member
Hello again,

Here is a line spectrum for a half wave rectified cosine wave taken right from a textbook. Note the amplitudes are shown as a straight vertical line always to the right of zero.

#### shosh

##### Member
actually i had it repeating on fc (which is 200hz). is there only one line at fc? or does it repeat every 200hz

#### MrAl

##### Well-Known Member
Hi,

There is one line for each frequency present. With only one frequency present there would only be one line.

#### Hayato

##### Member
You have 2 frequencies:
fm -> the message signal frequency (in this case 200 Hz).
fs -> the sampling frequency (in this case 300 Hz).

With a 200 Hz signal, your baseband bandwidth is 200 Hz and the passband bandwidth is 400 Hz.

When you sample anything, you create sampling marks in the Spectrum. Each sampling mark is located at a harmonic of the sampling frequency (n.fs, where n is the nth harmonic).

On the positive side of spectrum, basically you gonna have the sampling marks at 0 Hz, 300 Hz, 600 Hz, 900 Hz...
The passband message signal will repeat around each of the sampling marks, so for the harmonic n:

n = 0, 0Hz:
-200Hz and +200Hz

n = 1, 300Hz:
100Hz and 500Hz

n = 2, 600Hz:
400Hz and 800Hz

n = 3, 900 Hz:
700Hz and 1100Hz

As you can see, you are having Aliasing, for example, for n = 0, your signal is from -200 Hz to 200 Hz, BUT you have the aliased 100 Hz component there, from the n=1, etc...

Status
Not open for further replies.

Replies
5
Views
2K
Replies
1
Views
6K
Replies
5
Views
2K
Replies
3
Views
2K
Replies
2
Views
2K 