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

조회 수: 1 (최근 30일)
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).
  댓글 수: 2
Amy Peters
Amy Peters 2016년 4월 18일
I think I'm allowed to use the "built-in functions" in this question. I just don't know how to start writing something that would allow me to take the cosine transform. Would I use dct(x,n)?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 4월 18일
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)

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by