0% found this document useful (0 votes)
4 views1 page

Signal Modulation and FFT Analysis

The document contains MATLAB code that generates a sinusoidal signal and applies a modulation technique based on the sign of the signal. It computes the Fast Fourier Transform (FFT) of both the original and modulated signals and plots their spectra. Additionally, it visualizes the original and modulated signals in the time domain using plots.

Uploaded by

Sarthak Girhotra
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Signal Modulation and FFT Analysis

The document contains MATLAB code that generates a sinusoidal signal and applies a modulation technique based on the sign of the signal. It computes the Fast Fourier Transform (FFT) of both the original and modulated signals and plots their spectra. Additionally, it visualizes the original and modulated signals in the time domain using plots.

Uploaded by

Sarthak Girhotra
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

clc;

clear all;
close all;

b=0;
fc= 0.05;
n= [0:0.3:20];
delta= 0.01;
x_n= sin(2*pi*fc*n);
for i= 1:length(n)
t= (x_n(i)-b);
y= sign(t);
if y==1
y_n(i+1) =x_n(i)+delta;
b= y_n(i+1);
else
y_n(i+1)= x_n(i)-delta;
b= y_n(i+1);
end
end
ffttx= fft(x_n);
ffttx_a= abs(ffttx);
ffty= fft(y_n);
ffty_a= abs(ffty);

%figure(1)
plot (fftshift(ffttx_a),'g');
hold on
plot (fftshift(ffty_a),'b');
title('Spectra');
xlabel('-----------f--------->');
ylabel('-----------X(f)/Y(f)------>');
legend('Original Signal','Modulated Signal'
);

%figure(2)
plot(n,x_n,'g');
hold on
n1= [0 n];
stairs(n1,y_n,'b')
title('Signals');
xlabel('-----------t/n--------->');
ylabel('-----------x(t)/y[n]------>');
legend('Original Signal','Modulated Signal');
legend('Original Signal','Modulated Signal');

You might also like