You are on page 1of 2

% Mehmet Selim Yüksektepe

% 181201022
% % 1 2
row = 6;
fs = 500;
Ts = 1/fs;
fc =100;
fm = 5;
t = 0:Ts:1;
m_t = cos(2*pi*fm*t);
mu = 0.5;
u_t = (1+mu*m_t).*cos(2*pi*fc*t);
subplot(row,2,1);
% % % 3
plot(t,u_t);
subplot(row,2,2);
plot(t,m_t);
% % % 4
ut_fft = fftshift(abs(fft(u_t)));
mt_fft = fftshift(abs(fft(m_t)));
L = length(t);
f = ((-L/2 +1):(L/2))/L;
subplot(row,2,3);
plot(f,mt_fft);
subplot(row,2,4);
plot(f,ut_fft);
% % % 5
A = 0.5;
r_t = A * u_t;
p_t = r_t .* cos(2*pi*fc*t);

subplot(row,2,5);
plot(t,r_t);
subplot(row,2,6);
plot(t,p_t);
% % % 6 7
rt_fft = fftshift(abs(fft(r_t)));
pt_fft = fftshift(abs(fft(p_t)));

subplot(row,2,7);
plot(t,rt_fft);
subplot(row,2,8);
plot(t,pt_fft);
fcut = 8;
Lpfilter = (f >= -fcut) - (f>fcut);
lpfilter = abs(ifft(Lpfilter));
lpfilter(ceil(L/2):end) = [];

r1t = filter(lpfilter,1,abs(p_t));
r1f = fftshift(abs(fft(r1t)));

subplot(row,2,9);
plot(t,r1t);
subplot(row,2,10)
plot(f,r1f);

% % % 8
[r2t ~] = envelope(r_t);
r2f = fftshift(abs(fft(r2t)));
% % % 9
MM = [m_t.',r1t.',r2t.'];
R =corrcoef(MM)

You might also like