Main Content

dst

(Not recommended) Discrete sine transform

dst is not recommended.

Description

y = dst(x) computes the discrete sine transform of x according to the equation

y(k)=n=1Nx(n)sin(πknN+1),k=1,...,N

If x is a matrix, then dst applies to each column. For best performance, the number of rows in x must be 2m – 1, where m is an integer.

example

y = dst(x,n) truncates the vector x or pads it with trailing zeros to length n before computing the transform. If x is a matrix, then dst truncates or pads each column.

Examples

collapse all

Find the discrete sine transform of the exponential by using dst, and then invert the result by using idst.

Create a time vector sampled in increments of 0.1 second over a period of 10 seconds.

Ts = 0.1;
t = 0:Ts:10;

Compute and plot the exponential signal.

x = exp(t);
plot(t,x)
xlabel('Time (seconds)')
ylabel('Amplitude')

Figure contains an axes object. The axes object with xlabel Time (seconds), ylabel Amplitude contains an object of type line.

Compute the discrete sign transform of the signal, and create the vector f that corresponds to the sampling of the signal in frequency space.

y = dst(x);
fs = 1/Ts;
f = (0:length(y)-1)*fs/length(y);
plot(f,y)
xlabel('Frequency (Hz)')
ylabel('Magnitude')

Figure contains an axes object. The axes object with xlabel Frequency (Hz), ylabel Magnitude contains an object of type line.

Compute the inverse discrete sine transform of y, and plot the result.

z = idst(y);
figure
plot(t,z)
xlabel('Time (seconds)')
ylabel('Amplitude')

Figure contains an axes object. The axes object with xlabel Time (seconds), ylabel Amplitude contains an object of type line.

Input Arguments

collapse all

Input array, specified as a vector or a matrix. If x is a matrix, then dst applies to each column.

Data Types: double

Transform length, specified as a nonnegative integer. If x is a vector, then dst truncates it or pads it with trailing zeros, so that the resulting vector has n elements. If x is a matrix, then dst truncates or pads each column.

Data Types: double

Output Arguments

collapse all

Discrete sine transform coefficients, returned as a vector or matrix of the same size as x.

Version History

Introduced before R2006a

expand all

See Also

Go to top of page