Skip to main content
replaced http://dsp.stackexchange.com/ with https://dsp.stackexchange.com/
Source Link

I went down the ifft route. Based off this post: What effect does a delay in the time domain have in the frequency domain?What effect does a delay in the time domain have in the frequency domain?

My code looks like this:

N = length(h1_data(:,1)); %N = (2^nextpow2(N)); L = h1_cord(18,1) - h1_cord(2,1); Cph = 2628; %Generate real frequency vectors (negative and positive freal = linspace(nyq, -nyq, N); fd = (L/Cph) - (1./freal); fd = fs * fd; fd = fd * -1; %fd(1) = fd(2); f = exp((-1i*2*pi*(1:N).*fd)/N); %f(N/2+1:end) = fliplr(f(1:N/2)); %f = [f fliplr(f)]; %Overwrite with freqs we don't care about fs = 1/(h1_time(2) - h1_time(1)); nyq = fs/2; bin = nyq/(N/2); f0bin = round(250e3/bin); f1bin = round(1.25e6/bin); f(1:f0bin) = 1; f(f1bin:N/2) = 1; f(N/2+1:f1bin+N/2) = 1; f(N-f0bin:end) = 1; f(1) = 1; g = real(ifft(f)); b = [g(N/2+1:end) g(1:N/2)]; b = b .* hamming(N)'; fvtool(b,1); 

I went down the ifft route. Based off this post: What effect does a delay in the time domain have in the frequency domain?

My code looks like this:

N = length(h1_data(:,1)); %N = (2^nextpow2(N)); L = h1_cord(18,1) - h1_cord(2,1); Cph = 2628; %Generate real frequency vectors (negative and positive freal = linspace(nyq, -nyq, N); fd = (L/Cph) - (1./freal); fd = fs * fd; fd = fd * -1; %fd(1) = fd(2); f = exp((-1i*2*pi*(1:N).*fd)/N); %f(N/2+1:end) = fliplr(f(1:N/2)); %f = [f fliplr(f)]; %Overwrite with freqs we don't care about fs = 1/(h1_time(2) - h1_time(1)); nyq = fs/2; bin = nyq/(N/2); f0bin = round(250e3/bin); f1bin = round(1.25e6/bin); f(1:f0bin) = 1; f(f1bin:N/2) = 1; f(N/2+1:f1bin+N/2) = 1; f(N-f0bin:end) = 1; f(1) = 1; g = real(ifft(f)); b = [g(N/2+1:end) g(1:N/2)]; b = b .* hamming(N)'; fvtool(b,1); 

I went down the ifft route. Based off this post: What effect does a delay in the time domain have in the frequency domain?

My code looks like this:

N = length(h1_data(:,1)); %N = (2^nextpow2(N)); L = h1_cord(18,1) - h1_cord(2,1); Cph = 2628; %Generate real frequency vectors (negative and positive freal = linspace(nyq, -nyq, N); fd = (L/Cph) - (1./freal); fd = fs * fd; fd = fd * -1; %fd(1) = fd(2); f = exp((-1i*2*pi*(1:N).*fd)/N); %f(N/2+1:end) = fliplr(f(1:N/2)); %f = [f fliplr(f)]; %Overwrite with freqs we don't care about fs = 1/(h1_time(2) - h1_time(1)); nyq = fs/2; bin = nyq/(N/2); f0bin = round(250e3/bin); f1bin = round(1.25e6/bin); f(1:f0bin) = 1; f(f1bin:N/2) = 1; f(N/2+1:f1bin+N/2) = 1; f(N-f0bin:end) = 1; f(1) = 1; g = real(ifft(f)); b = [g(N/2+1:end) g(1:N/2)]; b = b .* hamming(N)'; fvtool(b,1); 
Source Link

I went down the ifft route. Based off this post: What effect does a delay in the time domain have in the frequency domain?

My code looks like this:

N = length(h1_data(:,1)); %N = (2^nextpow2(N)); L = h1_cord(18,1) - h1_cord(2,1); Cph = 2628; %Generate real frequency vectors (negative and positive freal = linspace(nyq, -nyq, N); fd = (L/Cph) - (1./freal); fd = fs * fd; fd = fd * -1; %fd(1) = fd(2); f = exp((-1i*2*pi*(1:N).*fd)/N); %f(N/2+1:end) = fliplr(f(1:N/2)); %f = [f fliplr(f)]; %Overwrite with freqs we don't care about fs = 1/(h1_time(2) - h1_time(1)); nyq = fs/2; bin = nyq/(N/2); f0bin = round(250e3/bin); f1bin = round(1.25e6/bin); f(1:f0bin) = 1; f(f1bin:N/2) = 1; f(N/2+1:f1bin+N/2) = 1; f(N-f0bin:end) = 1; f(1) = 1; g = real(ifft(f)); b = [g(N/2+1:end) g(1:N/2)]; b = b .* hamming(N)'; fvtool(b,1);