hello, i am new in matlab. i have created the modulated signal but don't know how to apply the hamming window to the signal.
clc
clear all
close all
Ac = 5;
fc = 10000;
Am = 1;
fm = 1000;
Tc = 1 / fc;
Ts = Tc / 100;
Pm = 1 / fm;
t = 0 : Ts : 5*Pm;
Vm = Am*cos(2*pi*fm*t);
Vc = Ac*sin(2*pi*fc*t);
Vam = (Ac+Vm).*sin(2*pi*fc*t);
figure(1)
subplot(311)
plot(t,Vm);
title('Message signal');
xlabel('Time(s)');
ylabel('Amplitude(V)');
grid
subplot(312)
plot(t,Vc);
title('Carrier singal');
xlabel('Time(s)');
ylabel('Amplitude(V)');
grid
subplot(313)
plot(t,Vam);
title('Amplitude Modulated Signal');
xlabel('Time(s)');
ylabel('Amplitude(V)');
grid
L=10^24;
k=0:L-1;
f=k./(L*Ts);
Xam=(2/L)*abs(fft(Vam,L));
figure(2)
plot(f, Xam)
title('Spectrum of modulated signal')
xlabel('Frequency(Hz)')
ylabel('Magnitude')
grid on