PAM sampling flat-top of an sinus signal
10 views (last 30 days)
Show older comments
Hi,
i need to do a flat-top PAM sampling of an sinus signal of 800Hz with a sampling frequency of 3000hz. I did natural sampling with this code, but i need it falt-topped, i don't know how to do that... Thanks!
Here is my working code for the natural PAM sampling :
if true
clear all;
close all;
Fs = 1e9;
t = 0:1/Fs:(0.2e-2);
fc = 3000; %sampling frequency
fm = 800; %message frequency
a = 1;
vm = a.*sin(2*pi*fm*t); %message
pulseperiods = [0:10]*0.25e-3;
pulsewidth = (1/fc)/3;
vc = pulstran(t,pulseperiods,@rectpuls,pulsewidth);
y = vc.*vm;
figure
subplot(3,1,1);
plot(t,vm); % plot message
xlabel('Temps');
ylabel('Amplitude');
title('Message');
subplot(3,1,2);
plot(t,vc); % plot pulse
xlabel('Temps');
ylabel('Amplitude');
title('Switching waveform');
subplot(3,1,3);
plot(t,y); % plot PAM naturel
xlabel('Temps');
ylabel('Amplitude');
title('PAM naturel');
end
0 Comments
Answers (0)
See Also
Categories
Find more on Signal Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!