주요 콘텐츠

idst

(Not recommended) Invert discrete sine transform

idst is not recommended.

Description

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

x(k)=2N+1n=1Ny(n)sin(πknN+1), k=1,...,N

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

example

x = idst(y,n) truncates the vector y or pads it with zeros to length n before computing the transform.

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 y is a matrix, then idst applies to each column.

Data Types: double

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

Data Types: double

Output Arguments

collapse all

Inverse discrete sine transform coefficients, returned as a vector or matrix of the same size as y.

Version History

Introduced before R2006a

expand all

See Also