Lab Report 1
Lab Report 1
Code:
f=50;
fs=1000;
t=-0.1:1/fs:0.1;
x=sin(2*pi*f*t);
subplot(2,3,1)
plot(t,x)
title('x=sin(w*t)')
f2=100;
y=sin(2*pi*f2*t);
subplot(2,3,2)
plot(t,y)
title('y=sin(2*pi*f2*t);')
z=x+y;
subplot(2,3,3)
plot(t,z)
title('z=x+y;')
Y=fft(z)
freq=linspace (-fs/2, fs/2, length(Y));
subplot(2,3,4)
plot(freq,abs(fftshift(Y)))
title('magnitude')
subplot(2,3,5)
plot(freq,angle(fftshift(Y)))
title('angle')
figure
f=50;
fs=1000;
t=-0.1:1/fs:0.1;
x=sin(2*pi*f*t).*heaviside(t);
subplot(2,3,1)
plot(t,x)
title('x=sin(w*t).*heaviside(t);')
f2=100;
y=sin(2*pi*f2*t).*heaviside(t-0.03);
subplot(2,3,2)
plot(t,y)
title('y=sin(w*t).*heaviside(t-0.03)')
z=x+y;
subplot(2,3,3)
plot(t,y)
title('z=x+y')
Y=fft(z)
freq=linspace (-fs/2, fs/2, length(Y));
subplot(2,3,4)
plot(freq,abs(fftshift(Y)))
title('magnitue')
subplot(2,3,5)
plot(freq,angle(fftshift(Y)))
title('angle')
OUTPUT:
Fig # 01
Fig # 02
QUESTIONS:
1. Provide your analysis for the for the change in frequency fn?
Answer: By increased in frequency fn positive cycle of the signal increases and negative
decreases. Number of cycles per second also increases and we get the sharp peaks in magnitude.
While by decreasing fn it will be vice versa.
2. What is meant by frequency resolution and time resolution?
Answer: Frequency resolution is the distance in Hz between two adjacent data points In
Frequency Domain. In frequency resolution we plot our signal with respect to frequency while
In Time resolution we can plot our signal with respect to time because its means frequency
domain.
3. Do you think Fourier Transform provides all required information for stationary and
non-stationary signals?
Answer: According to my observation Yes, Fourier Transform provides all required information
for stationary and non-stationary signals as we analyze in this code.
The end