We have a ASK modulated signal. We need the Fourier Transform, therefore I used FFT, but do I need to abs()
for only one side? And is my code complete? I'm also not sure how to transfer from time domain (t) to frequency domain (f) in order to do the matlab.
clear all;
clc;
close all;
F1=input('Enter the frequency of carrier=');
F2=input('Enter the frequency of pulse=');
A=3;
t=0:0.001:1;
x=A.*sin(2*pi*F1*t);
u=A/2.*square(2*pi*F2*t)+(A/2);
v=x.*u;
figure
subplot(4,1,1);
plot(t,x);
xlabel('Time');
ylabel('Amplitude');
title('Carrier');
grid on;
subplot(4,1,2);
plot(t,u);
xlabel('Time');
ylabel('Amplitude');
title('Square Pulses');
grid on;
subplot(4,1,3);
plot(t,v);
xlabel('Time');
ylabel('Amplitude');
title('ASK Signal');
grid on;
fs=100;
q=fft(v);
subplot(4,1,4);
plot(fs,q);
grid on;