Write a self contained program which will take a signal and compute its Cosine transform

1 visualizzazione (ultimi 30 giorni)
I'm new to MATLAB and was wondering if anyone could help me with this problem? I don't know where to start.
Write a self contained program which will take a signal and compute its Cosine transform. Have the program decide how many significant coefficients are necessary for a given input tolerance (such as .01, or .001).

Risposte (1)

Walter Roberson
Walter Roberson il 18 Apr 2016
You use a "for" loop from 0 to half of the number of points. In each one, you use a vectorized cos() calculation and add the vector of results to your running total. Like
total = zeros(size(x));
for K = 1 : 5
total = total + cos(f(x,K));
end
for some f(x,K)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by