Fourier transform in continuous time
49 次查看(过去 30 天)
显示 更早的评论
hi guys, i trying out an example from the textbook 'DSP using matlab'.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153605/image.png)
for t=0:100
a=-100:1
x=exp(a*t)
answer= fft(x)
end
is there any mistake in my code as i could not get the right answer using matlab
0 个评论
回答(2 个)
Star Strider
2016-1-27
For continuous time signals, you have to use the Symbolic Math Toolbox:
syms a t w
FT = int(exp(a*t) * exp(j*w*t), t, 0, Inf)
FT =
limit(exp(t*a)*exp(t*w*1i), t, Inf)/(a + w*1i) - 1/(a + w*1i)
If ‘a’ is negative, this is much more tractable.
3 个评论
Walter Roberson
2016-1-27
If you were to add the assumption a<0 then it might become more readable.
syms a t w
assume(a<0);
FT = int(exp(a*t) * exp(j*w*t), t, 0, Inf)
Santiago Vélez Jr. Casallas
2022-1-14
编辑:Santiago Vélez Jr. Casallas
2022-1-14
The most direct way is using fourier(f), where "f" is your continuous signal written in symbolic type (sym). You mut first declare the symbols for the time and frequency with "syms", and then apply:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/862430/image.png)
An additional tip:
--> for me this function doesn't work with euler exponential functions, unless you declare them properly. For example, with Laplace functions:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/862435/image.png)
As you can see it doesn't give error,but the result is the very expresion I wrote.
This is because the euler function has especial treatments in fourier tranforms or the integral will not converge. In this example, the constant that acompanies variable "t" (in this case 5), and "t" itself, must be positive, you can find it in Laplace's theory. So you must specify this, or the integral that matlab does will just not converge:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/862440/image.png)
I did it with abs(), but it can b done with assume() funtion as well,for example:
assume([t],'positive');
You can know further about fourier(t) function in here: https://la.mathworks.com/help/symbolic/sym.fourier.html
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!