I have an upconverted signal that is around the carrier frequency fc. I'm trying to plot this signal's FFT but failed to scale the frequency axis correctly as the signal's FFT is centered around the DC. I tried:
f = 1;
fs = 10*f;
t = 0:1/fs:5;
fc = 100;
x = sin(2*pi*f*t);
x_up = x .* exp(1i*2*pi*fc*t);
f_fc = linspace(-fc,fc,length(t));
plot(f_fc,fftshift(abs(fft(x_up))))
How should I scale it correctly? Thanks.