How can I generate time shifted Dirac delta function(impulse response)?

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)

回答 (2 件)

Arthi Sathyamurthi
Arthi Sathyamurthi 2021 年 3 月 26 日

0 投票

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 件のコメント

Berkay Tunakan
Berkay Tunakan 2022 年 10 月 14 日
It worked perfectly. Thank you for information but I need to go one step further. How can i plot
h(tau) = (0.7*dirac(tau))- (0.6*dirac(tau-(4e-10)) + 0.5*(dirac(tau-(6e-10)))) value?
Saeed Rezaee
Saeed Rezaee 2024 年 3 月 1 日
delta function in Matlab gives the impulse response of any LTI system. Simply define a series of delay functions in s domain. Remember, a delay in any LTI function in time domain translates into a multiplications with an exponential in s domain. Now, what you have is a series of exponetials. Two plot the time domain response, the easiets way is to plot the delta response of this series. In summary, you need the write the followinh.
Y=exp(-T1*s)+exp(-T2*s)+exp(-T3*s);
delta(Y)
Walter Roberson
Walter Roberson 2024 年 3 月 1 日
A problem with fplot(h) is that fplot() is not going to know that it has to plot at time 0, 4e-10 and 6e-10 specifically, and is likely to interpolate between times "near" those... but dirac delta is non-zero only where the time expression is exactly zero.
You could matlabFunction(h) and then feed it times that included "exactly" 0, 4e-10, 6e-10 ... but of course times are not represented in base 10 for numeric functions, and it might be difficult to get exact matches...
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)
ans = 1×3
0 Inf 0
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.
Walter Roberson
Walter Roberson 2024 年 3 月 2 日
Good point about dirac(0) being inf.

サインインしてコメントする。

Carlos M. Velez S.
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

カテゴリ

ヘルプ センター および File ExchangeTime and Frequency Domain Analysis についてさらに検索

質問済み:

2021 年 3 月 4 日

回答済み:

2025 年 7 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by