FFT of ON OFF signal
Show older comments
clc,close all,clear all
codn=70;
% fc=6e+3;
fs=36000;
bode=1000;
code=round(rand(1,codn));
code_len=round(1/bode/(1/fs));
for i=1:codn
x((i-1)*code_len+1:code_len*i)=code(i);
end
figure(1)
plot(x)
axis([0 2520 -0.5 1.5])

y=abs(fft(x))
figure(2)
title('orignal baseband signal')
xlabel('time');
ylabel('amplitude')
df=-fs/2:fs/length(y):fs/2-1; (PROBLEM IN THIS FREQUENCY RANGE )
plot(df,y)

This is my code which i have write to take FFT of ON OFF signal but issue is that i am unable to find exact frequency spectru(df=-fs/2 : fs/length(y) : fs/2-1) of ON OFF signal
Accepted Answer
More Answers (0)
Categories
Find more on Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!