How to go from frequency response of simple delay to impulse response.
1 view (last 30 days)
Show older comments
Lets say my transfer function is H(f)=exp(-j2pi*f*tau) where tau is delay in seconds. In time domain we know H(f) is h(t)=δ(t-tau) . How do I show this in MATLAB? Below is what I have tried using codes that were related to this question.
clear all
N=1000; f=1:1:1000; tau=5; H=exp(-1i*2*pi.*f*tau); FR_positive_frequency_only=H; FR_data = zeros(1,2*N); FR_data(1:N) = FR_positive_frequency_only; FR_data(N+1:N*2) = fliplr(FR_positive_frequency_only(1:end));
IR_data = ifft(FR_data); figure; stem(IR_data);
IR_data=ifft(ifftshift(FR_data)); figure; stem(IR_data);
Thank you for the help.
0 Comments
Accepted Answer
Rick Rosson
on 11 Sep 2014
Edited: Rick Rosson
on 11 Sep 2014
Fs = 2000;
N = 12000;
dF = Fs/N;
f = (-Fs/2:dF:Fs/2-dF)';
tau = 5;
H = exp(-1i*2*pi*f*tau);
h = real(ifft(ifftshift(H)));
dt = 1/Fs;
t = dt*(0:N-1)';
plot(t,h);
0 Comments
More Answers (0)
See Also
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!