Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Sum of Cosines (Perhaps DCT?)

Subject: Sum of Cosines (Perhaps DCT?)

From: Bill Woessner

Date: 9 Jul, 2012 01:02:41

Message: 1 of 3

Perhaps this belongs in a signal processing newsgroup. But here goes...

I need to evaluate the following sum quickly:

 N
sum A(k) * cos(2 * pi * k * t + P(k))
k=1

where A and P are Nx1 arrays. The P term is probably not too important, if it helps to omit it. Is there some quick way of doing this, perhaps with a clever application of the DCT?

Thanks in advance,
Bill Woessner

Subject: Sum of Cosines (Perhaps DCT?)

From: Matt J

Date: 9 Jul, 2012 06:29:14

Message: 2 of 3

Bill Woessner <woessner@gmail.com> wrote in message <6dba1fe7-cc29-4a35-8dce-7df5bea9aec4@googlegroups.com>...
> Perhaps this belongs in a signal processing newsgroup. But here goes...
>
> I need to evaluate the following sum quickly:
>
> N
> sum A(k) * cos(2 * pi * k * t + P(k))
> k=1
>
> where A and P are Nx1 arrays. The P term is probably not too important, if it helps to omit it. Is there some quick way of doing this, perhaps with a clever application of the DCT?
===========

I can see that working if your sampling times t are related to integers as
t=(n-0.5)/(2*N), n=1,2,...N

In that case, and with P(k)=0, your sum boils down immediately to the formula for DCT-II as defined here

http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-II

Subject: Sum of Cosines (Perhaps DCT?)

From: Bruno Luong

Date: 9 Jul, 2012 07:07:10

Message: 3 of 3

Non nil phase term P is manageable by FFT or CST/DST.

Bruno

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us