You are on page 1of 1

Lab 02

Signals and Continuous Time Fourier Transform


Objective:
In today’s lab, we will take a continuous time signal and use “fft” to estimate its continuous time Fourier
transform.
Commands to be used:
• plot • real • exp • imag • fft • fftshift • linspace
• sin/cos

Help on these commands is available in MATLAB help directory.


Procedure:
1. Open M-file or M-Book
2. Save it by any useful name but remember not to start the name by any numeric digit, do not use any special
character other than under-the-score ( _ ) and also remember not to give any space in the name.

Task I
3. In order to generate a continuous time signal we require a fundamental frequency fn and a simulated frequency
fs.
4. Firstly, take a continuous time sinusoidal with fundamental frequency of fn=50 Hz & a simulated sampling
frequency of fs=1000Hz.
2𝜋𝑓𝑛𝑡
𝑥(𝑡) = 𝑐𝑜𝑠 ( )
𝑓𝑠
5. Let “t” be an integer index.
6. In order to analyze its frequency spectrum using “fft” following step needs to be taken.
a. Generate a variable “N” indicating the size of frequency components let it be 1200.
b. Now calculate the Fourier transform using “fft”, and use “fftshift” to make the spectrum centered.
7. Use “linspace” to generate Ω-axis.
8. Now by varying the variable “t” & “fn” analyze the changes in the spectrum. As the spectrum is a complex
entity used magnitude, phase, real, and imaginary properties to conclude proper analysis.

Task II
Generate a signal x2(t) with two sinusoids, i.e., the signal now comprises of the sum of two cosine waves with
different frequencies (say 50 Hz and 80 Hz). Repeat steps 5 t 8.

Task III
Implement a unit step function and plot for few values of t. You may take help from using commands like sign
and eps.

You might also like