
a)
clc;
clear all;
close all;
t=0:0.0001:(5/6)
f=5*sin(8*pi*t)+6*sin(16*pi*t)
figure
plot(t,f)
xlabel('t')
ylabel('f(t)')
grid on
b)
clc;
clear all;
close all;
t=0:(1/24):(5/6)
n=0:1:20
Ts=1/24
fn=5*sin(8*pi*n*Ts)+6*sin(16*n*Ts)
fs=24
fftSignal = fft(fn);
figure;
stem(abs(fftSignal));
title('amplitude of f(t)');
xlabel('Frequency (Hz)');
ylabel('magnitude');
c) time period of given signal is LCM(1/4,1/8) or GCD (4,8)
fundamental time period=4
frequency of the signal =1/4 = 0.25
sampling freuency >=(1/4)*2=0.5 to reconstruct the signal from samples
code:
clc;
clear all;
close all;
t=0:(1/24):(5/6)
n=0:1:20
Ts=2
fn=5*sin(8*pi*n*Ts)+6*sin(16*n*Ts)
figure;
stem(n,fn);
title('sampled signal');
xlabel('n');
ylabel('f(n)');
Leave a comment