Вы находитесь на странице: 1из 1

Matlab Activity 1&2: Line Spectra

Due date: Activity 1 August 31 for Section A, September 2 for Section B


Activity 2 - September 7 for Section A, September 9 for Section B
Activities adapted from J. Fessler

Line spectrum a frequency domain plot that that


shows the frequency components of a signal.
Signal representations:
o A plot of signal as a function of time: () vs ,
such as:

Gema Abrajano
SY 1516, First Sem
Tcom 121.2

Ignore the 2nd half (mirror image) of the plot


Determine the frequency in Hz from the Matlab

index + 1 using = .

e.g. =

2411
(200)
600

= 80

Matlab Activity 1

o
o
o
o
o

A complicated formula, such as:


() = 8 cos 2(240) 6 sin(290)
A simple formula as a sum of sinusoids, such as:
() = 4 + 4 cos(280) + 6 cos(290 +
2)
A list of the frequency, positive amplitude, and
phase ( , , ) of each component, such as:
o (0, 4, N/A); (80, 4, 0); (90, 6, /2)
A line spectrum (magnitude spectrum) that
shows the frequencies and amplitudes of each
sinusoidal component, such as:

Matlab commands:
>>
>>
>>
>>

N=600;
t=[0:N-1]/200;
x=4+4*cos(2*pi*80*t)+6*cos(2*pi*90*t);
stem(2/N*abs(fft(x)));

FFT output of the command above:

Note: this plot is not the same as the first one.


- The first array value is 20 , twice as it should be
- The horizontal axis is not in frequency, Hz.
- Each of the non-zero lines appears twice (mirror
image).
The true line spectrum can be taken by:
- Dividing the FFT output value in the first array
element by 2 to get the DC value 0 .

1. Implement the given Matlab code for the same


given signal. Submit the following files:
a. m-file
b. .fig file of the plot of () vs , put axes
names for and axes, and the plot
title should be your first names.
c. .fig file of the stem plot, put axes names
for and axes, and the plot title
should be your first names.
2. Do (1) for the ff. signal, making necessary
changes in the code if needed:
() = 7(2440)
3. Submit all six files in a zip file with your ID
numbers as filename (xxxxxx_xxxxxx).
Matlab Activity 2
1. Sketch the TRUE spectrum of the following
signals. You will have to make modifications in
the given code to show only the real spectrum.
Save the same 3 files for each one as in the
previous activity.
a. () = 7 cos 2100 + 8 cos 2200
b. () = 7 sin 2100 8 sin 2200
c. () = 5 cos 250 + 12 sin 250
d. () = sin2 250
2. Answer the following questions for each signal
in (1)(in a Word file):
a. How many sinusoidal components are
present? What are the amplitude,
frequency, and phase of each
component?
b. What is the fundamental frequency?
c. What is the average power?
3. Submit all 13 files in a zip file with your ID
numbers as filename (xxxxxx_xxxxxx).

Вам также может понравиться