(To be removed) Inverse discrete cosine transform (IDCT)
IDCT object computes the inverse discrete cosine
transform (IDCT) of an input.
To compute the IDCT of an input:
Starting in R2016b, instead of using the
method to perform the operation defined by the System
object, you can call the object with arguments, as if it were a function. For
y = step(obj,x) and
y = obj(x)
perform equivalent operations.
idct = dsp.IDCT returns a inverse discrete cosine transform
idct. This object computes the IDCT of
a real or complex input signal using the
Table lookup method.
idct = dsp.IDCT('
returns an inverse discrete cosine transform (IDCT) object,
idct, with each property set to the specified value.
Method to compute sines and cosines
Specify how the IDCT object computes the trigonometric function values as
|step||Inverse discrete cosine transform (IDCT) of input|
|Common to All System Objects|
Allow System object property value changes
Note: This example runs only in
R2016b or later. If you are using an earlier release, replace each call to the
function with the equivalent
step syntax. For example,
myObject(x) becomes step(myObject,x).
Use DCT to analyze the energy content in a sequence:
x = (1:128).' + 50*cos((1:128).'*2*pi/40); dct = dsp.DCT; X = dct(x);
Set the DCT coefficients which represent less than 0.1% of the total energy to 0 and reconstruct the sequence using IDCT.
[XX, ind] = sort(abs(X),1,'descend'); ii = 1; while (norm([XX(1:ii);zeros(128-ii,1)]) <= 0.999*norm(XX)) ii = ii+1; end disp(['Number of DCT coefficients that represent 99.9%',... 'of the total energy in the sequence: ',num2str(ii)]);
Number of DCT coefficients that represent 99.9%of the total energy in the sequence: 10
XXt = zeros(128,1); XXt(ind(1:ii)) = X(ind(1:ii)); idct = dsp.IDCT; xt = idct(XXt); plot(1:128,[x xt]); legend('Original signal','Reconstructed signal',... 'location','best');
This object implements the algorithm, inputs, and outputs described on the IDCT block reference page. The object properties correspond to the block parameters.
Warns starting in R2019a
object will be removed in a future release. Use
This table shows typical usage of the System object and explains how to update existing code to use the equivalent function.
|If your code has this form (R2016b or later):||If your code has this form (prior to R2016b):||Use this code instead:|
idctObj = dsp.IDCT; xt = idctObj(X);
The variable, X represents the DCT of a time-domain signal.
idctObj = dsp.IDCT; xt = step(idctObj,X);
xt = idct(X);
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).