- #1
sara_UK
- 4
- 0
Hello guys..
I am trying to write a code for ASK in Matlab, but it doesn't give me the final figure!
% Generating a input square wave
x1 = 0:(pi/100):(10*pi);
y1 = square(x1);
A = plot(x1,y1);
figure(1),A,title( 'Square wave');xlabel('x'); ylabel('y');ylim([0,1]);grid;
% Generating a carrier(cosine wave) with a higher frequency as compared to sq.wave
f=0.8
t = 0:(pi/100):(10*pi);
y2 = cos(2*pi*f*t);
figure(2),B = plot(t,y2),title( 'Sine wave');xlabel('x'); ylabel('y');ylim([-2,2]); xlim([0,35]);grid;
ASK = A.^B;
figure(3),plot(t,ASK),title('ASK');xlabel('x'); ylabel('y');ylim([-2,2]); xlim([0,35]);grid;
your helpd would be very much appriciated .
Thanks
I am trying to write a code for ASK in Matlab, but it doesn't give me the final figure!
% Generating a input square wave
x1 = 0:(pi/100):(10*pi);
y1 = square(x1);
A = plot(x1,y1);
figure(1),A,title( 'Square wave');xlabel('x'); ylabel('y');ylim([0,1]);grid;
% Generating a carrier(cosine wave) with a higher frequency as compared to sq.wave
f=0.8
t = 0:(pi/100):(10*pi);
y2 = cos(2*pi*f*t);
figure(2),B = plot(t,y2),title( 'Sine wave');xlabel('x'); ylabel('y');ylim([-2,2]); xlim([0,35]);grid;
ASK = A.^B;
figure(3),plot(t,ASK),title('ASK');xlabel('x'); ylabel('y');ylim([-2,2]); xlim([0,35]);grid;
your helpd would be very much appriciated .
Thanks