Computing the Discrete Fourier Transform at 1/10 the Fourier Frequency

1 view (last 30 days)
I was asked to evaluate the fourier transform of time series g(n)=(a*cos(2*pi*f*t(n))) and then evaluate at 1/10 the fourier frequency
I computed the normal fourier transform. Simple! But now I am asked to computing the Discrete Fourier Transform at 1/10 the Fourier Frequency without any changes to the sample interval or time series. Does anyone have any ideas!
This code is the normal fourier transform
% discrete fourier transform plots
clear all; close all;
t=(-80:80);
N=161; %total observations
delt=1; %sample interval
a1=3; %arbitrary magnitude
%1.1
figure(1)
f1=4/N;
g=zeros(1,N);
for n = 1:(N)
g(n)=(a1*cos(2*pi*f1*t(n)));
end
G=zeros(1,N);
f=zeros(1,N);
for j = 1:(N)
f(j)=(j-81)/(N*delt);
for n = 1:N
sum=(1/N)*g(n)*exp(-1i*2*pi*(j-81)*((n-81)/N));
G(j)=G(j)+sum;
end
end
plot(f,real(G))
hold on
How do I fourier transform at 1/0 the fourier frequency as seen above?
I am stuck on wrapping my head around how to index this in matlab since the fourier transform will have ten times as many indexes than the time series
I was wondering if I have to round the time series to its nearest value when computing the transform with more indexes for frequency. This is my failed attempt seen below
G=zeros(1,N*10);
f=zeros(1,N*10);
q=zeros(1,N*10);
for j = 1:(N*10)
f(j)=(j*.1-81)/(N*delt);
q(j)=round(j*.1);
if round(j*.1) == 0
q(j)=1;
end
end
for j = 1:(N*10)
sum=(1/N)*g(q(j))*exp(-1i*2*pi*(j*.1-81)*((j*.1-81)/N));
G(j)=G(j)+sum;
end
plot(f,real(G))
blue is correct orange is my failed attempt
Any help would be greatly appreciated!
  2 Comments
David Goodmanson
David Goodmanson on 25 Feb 2021
Hi MK,
If you are sampling at a certain sampling frequency, there is a cetain time step between samples. If you sample at half that frequency, sampling goes slower and there is now twice as much time between sample steps as there was before, correct? So can take every other sample of the set you were doing before. And so forth ...
Maclane Keohane
Maclane Keohane on 25 Feb 2021
dfreq=0.1;
Nf=(N-1)/dfreq+1;
G=zeros(1,Nf);
f=zeros(1,Nf);
f1=-((N-1)/2)/(N+delt);
for j=1:Nf
f(j)=f1+(j-1)*dfreq/(N*delt);
for n=1:N
G(j)=G(j)+g(n)*exp(-1i*2*pi*(n-81)*(-((N-1)/2)+(j-1)*dfreq)/N);
end
G(j)=G(j)/N;
end
plot(f,real(G))
%I got it to work! thank you for commenting

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!