# Frequency Translation in MATLAB

1. ## Frequency Translation in MATLAB

I have to design a generic baseband filter. I have a C++ code which gives me filter coefficients based on the input parameters such as no. of taps, no. of bands, band edges, amplitudes and weights(code uses remez exchange algorithm).
I import the filter coefficients in MATLAB, do fft and plot the graph of it. I have to shift the graph such that its center is the center of baseband. I know that if I multiply filter coefficients with an exponential function and then do fft the resulting frequency domain output will be shifted in frequency [x(t)*e^j2*pi*f0 ==> X(f-f0)]. So to verify this I multiplied my filter coefficients with an exponential function and plotted it. But there is no change in the graph at all. Could someone tell me what am I doing wrong? I am posting the code and graph for reference.

Code:-
(b is the vector containing filter coefficients)
N = length(b);
fo = 200;
b1 = b.*exp(1j*2*pi*fo);
bins = [0:N-1];
bins_hz = bins*fs/N;
y = abs(fft(b1));

subplot(2,2,1)
plot(bins_hz, abs(fft(b)))
subplot(2,2,2)
plot(bins_hz, y)

•

2. ## Re: Frequency Translation in MATLAB

Hey,
you are multiplying all samples with a constant phase instead of linear phase to get shift in frequency domain.
you should do
b1 = b.*exp(1j*2*pi*fo*(1:N)/N);

1 members found this post helpful.

--[[ ]]--