how to apply hamming window to sinal

조회 수: 151 (최근 30일)
son
son 2014년 4월 1일
답변: dpb 2014년 4월 1일
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
%%Details
Ac = 5; % carrier amplitude
fc = 10000; % carrier frequency
Am = 1; % modulating signal amplitude
fm = 1000; % modulating signal frequency
Tc = 1 / fc; % carrier period
Ts = Tc / 100; % sample interval
Pm = 1 / fm; % signal period
t = 0 : Ts : 5*Pm; % 5 cycles
Vm = Am*cos(2*pi*fm*t); % message signal
Vc = Ac*sin(2*pi*fc*t); % carrier signal
Vam = (Ac+Vm).*sin(2*pi*fc*t); % amplitude modulated signal
%%Plot three signals
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
%%Plot spectrum of AM signal
L=10^24; % number of samples
k=0:L-1;
f=k./(L*Ts); % frequency in Hz
Xam=(2/L)*abs(fft(Vam,L));
figure(2)
plot(f, Xam)
title('Spectrum of modulated signal')
xlabel('Frequency(Hz)')
ylabel('Magnitude')
grid on
%%window function

답변 (1개)

dpb
dpb 2014년 4월 1일
...
Vam = (Ac+Vm).*sin(2*pi*fc*t); % amplitude modulated signal
VamWindowed=Vam.*hamming(length(t),'periodic');
doc hamming
for (a little) more detail

카테고리

Help CenterFile Exchange에서 Hamming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by