1
$\begingroup$

Following is a SciLab code and Plots for Modulation of ASK Signal: My question is : For these particular values of fm and t, I get two weird small spikes on either side of main lobe, which doesn't cross zeros. Why is it happening and how to solve it?

clear;
clf();
fs=10000;
t=0:1/fs:5//time index
N=length(t);
f=fs*(-N/2:1:N/2-1)/N//freq index
n=length(f)
fm=0.5//modulating freq
fc=20//carrier freq

m=(squarewave(2*%pi*fm*t)+1)/2
c=cos(2*%pi*fc*t)

figure(0)
subplot(3,1,1)
title("Square wave(Modulating Signal)")
xlabel("time(s)")
ylabel("Voltage")
plot(t,m)
gca().data_bounds=[0 -2;5 2]

subplot(3,1,2)
title("Carrier Signal")
xlabel("time(s)")
ylabel("Voltage")
plot(t,c)

ask=m.*c//ASK Signal

subplot(3,1,3)
title("Amplitude Modulated Signal")
xlabel("time(s)")
ylabel("Voltage")
plot(t,ask)

figure(1)
title("Magnitude Spectrum of ASK")
xlabel("freq(Hz)")
ylabel("Magnitude")
plot(f,(fftshift(abs(fft(ask)))/(N/2)))
gca().data_bounds=[-60 0;60 0.7]

Time Domain Signals

Frequency domain Signal

$\endgroup$

1 Answer 1

0
$\begingroup$

You are multiplying a sine wave with a square wave. Multiplication in the time domain is convolution of transforms in the frequency domain. The transform of a square wave is a Sinc function, which includes all those ripples on each side, modulating the 2 sine wave spikes containing the frequency of a real square wave.

To get less ripples, use something with smoother corners than a square wave as the modulator, for instance by using raised cosine transitions between zeros and 1's in the data signal.

You can't get rid of the 2 sidebands, since that's what carries the information in the square wave or data. So the only way to completely get rid of the 2 side spikes is to get rid of the constant frequency modulating data.

$\endgroup$
1
  • $\begingroup$ Ok, thankyou very much $\endgroup$ Oct 23, 2023 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.