# Matlab FFT not producing symmetric spectrum

I am plotting a FFT of a sampled RC pulse but my resulting spectrum isn't symmetric - it's offset.

pulse = rcosdesign(.5, 6, 100)
T = .0001
ft = fft(pulse);
ft = fftshift(ft)
ft_mag = abs(ft);
freq = 1/(T*length(pulse))*(-length(pulse)/2:(length(pulse)/2-1))

plot(freq,ft_mag)


What's going on?

• what's rcosdesign function ? Apr 13 '19 at 9:59
• How is it offset? Jan 8 '20 at 23:16

The problem comes from the DFT size. Try the code below that uses power of 2 fft.

T = 1e-4;
fs = 1/T;
pulse = rcosdesign(.5, 6, fs);
L = length(pulse);
Nfft = 2^nextpow2(L);
ft = fft(pulse,Nfft);
ft = fftshift(ft);
ft_mag = abs(ft);
freq=(-Nfft/2:Nfft/2-1)/Nfft*fs;
plot(freq,ft_mag)
axis([-3 3 0 max(ft_mag)])


Please check the type of "pulse". Is it a real type or complex type?

I do not know what your "rcosdesign()" looks like, and I used "pulse = rand(1,99)" and got: