How do you do a sine transform in Matlab?
Show older comments
The sine transform is defined as

How do you do a sine transform and its inverse? The functions dst and idst are not recommended for some reason.
Accepted Answer
More Answers (2)
Bora Eryilmaz
on 19 Dec 2022
Edited: Bora Eryilmaz
on 19 Dec 2022
0 votes
According to Wikipedia, versions of it can be computed using the discrete cosine transform: "A DST-III or DST-IV can be computed from a DCT-III or DCT-IV (see discrete cosine transform), respectively, by reversing the order of the inputs and flipping the sign of every other output, and vice versa for DST-II from DCT-II. In this way it follows that types II–IV of the DST require exactly the same number of arithmetic operations (additions and multiplications) as the corresponding DCT types."
Signal Processing Toolbox has the dct command: https://www.mathworks.com/help/signal/ref/dct.html
It appears that the sine transform can be computed from the Fourier transform.
Example with a simple function
syms t w xi real
f(t) = exp(-t)*heaviside(t);
Fourier transform of f(t)
F(xi) = subs(fourier(f(t),t,w),w,2*sym(pi)*xi)
The sine transform is then
S(xi) = simplify(-F(xi) + F(-xi))/2i
Compare to the sine transform computed from the defining integral
S(xi) = int(f(t)*sin(2*sym(pi)*xi*t),t,-inf,inf)
Categories
Find more on Calculus 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!



