How can I generate time shifted Dirac delta function(impulse response)?
조회 수: 30 (최근 30일)
이전 댓글 표시
I want to make a impulse response of channel with below configuration.
How can I generate delta function with these value?
Ts = 2ns, fs = 50GHz, fc = 1GHz
impulse reponse of channel : h(τ) = 0.7δ(τ) − 0.6δ(τ − 4 · 10^−10) + 0.5δ(τ − 6 · 10^−10)
댓글 수: 0
답변 (2개)
Arthi Sathyamurthi
2021년 3월 26일
You can generate a time shifted dirac delta function by using the dirac function. Assuming the time shift to be a value ‘a’, dirac(x-a) generates a impulse at the value ‘a’. You can look how to do it in the Mathworks documentation here. This is how your impulse response equation would be,
h(tau) = (0.7*dirac(tau))- (0.6*dirac(tau-(4e-10)) + 0.5*(dirac(tau-(6e-10))))
You can either define ‘tau’ to be syms if you want h(tau) to be an equation or you can declare ‘tau’ as an array of values for which you want to plot the impulse response equation for a range.
댓글 수: 5
Paul
2024년 3월 2일
Even if one could get the times exactly correct, it won't help much because dirac returns inf for a numeric input for that case, which also won't show up on a plot
t = [-1 0 1];
dirac(t)
Some time ago I was working on a code to identify the coefficients of all diracs in a symbolic expression which could then be used to make an fplot.
Carlos M. Velez S.
2025년 7월 24일
If you want to apply the Dirac delta function in simulation to continuous-time systems, the following code is enough:
function y = delta_dirac(u)
[n,m] = size(u);
if max(n,m) ==1
dt = 1e-6; % Define a small time increment for the delta function
else
dt = u(2) - u(1);
end
y = zeros(n,m);
for i=1:max(m,n)
if u(i) == 0
y(i) = 1/dt;
else
y(i) = 0;
end
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!