i need to plot the amplitude of my signals
Afficher commentaires plus anciens
I don't know what I did wrong:
%variables
Am=5; %message signal amplitude
Ac=10; %message signal amplitude
t=0:0.001:1; %period
Fm=50; %message frequency
Fc=1000; %carrier frequency
%output graph preparation
m=Am*cos(2*pi*Fm*t); %signal equation
c=Ac*cos(2*pi*Fc*t); %carrier equation
%plot m(t) and its amplitude
figure;
plot(t,m);
xlabel('time');
ylabel('m(t)');
figure;
plot(t,abs(m));
xlabel('time');
ylabel('m(t)');
title('amplitude');
%plot c(t) and its amplitude
figure;
plot(t,c);
xlabel('time');
ylabel('c(t)');
figure;
plot(t,abs(c));
xlabel('time');
ylabel('c(t)');
title('amplitude');
%Sketch the magnitude of the multiplication of m(t) with c(t).
y=m.*c;
figure;
plot(t,y);
xlabel('time');
ylabel('y(t)');
figure
plot(t,abs(y));
xlabel('time');
ylabel('y(t)');
title('amplitude');
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 30 Déc 2016
0 votes
Your carrier frequency is 1000 times per second yet you're only taking samples every 1/1000 of a second. Do you see anything wrong with that? Have you ever heard of aliasing?
1 commentaire
sara jarikji
le 30 Déc 2016
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
