Programmable Digital Filter

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am working on a small project that causes holiday lights to flash in time to user specifiable frequency bands of music. I have a working prototype that uses an ADC, a Filter Bank, a DAC, and comparators. But there is a problem.

   

I can manually program the filter bank for any kind of response. I want the ability to configure it with a UART to allow user programmable frequency response and filter type. I do not think this is possible with the PSOC filter bank as there is no register for bandwidth, etc. It does not look like there is a register for the coefficients either.

   

Another option is to use the CPU to run an IIR algorithm and an external application that computes the coefficients. The main drawback to this is the filter needs CPU time. I can make this work but I would prefer to do it with the filter bank.

   

Any other options aside from using external IC chips?

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There is probably a better approach: A fast-fourier transformation will exactly deliver what you'd like to have and it uses less CPU than scanning the spectrum with IIR. There are several FFT algorithms ready-made in C-language. An entry-point is here: www.fftw.org/links.html

   

 

   

Bob

0 Likes

Hello Bob, did you use the fft library for PSoC 5LP? Do you know some tutorial for implementing it to PSoC with some easy example?

   

 

   

 

   

Michal

0 Likes

No examples. I would suggest you to start a new topic with an FFT question, somebody might have got something.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.

Here is my code with using CMSIS library. I made complex signal model sig = cos(fi) + j*sin(fi) using fasth math functions from CMSIS and I made complex fft. I'm sending computed spectrum using USBUART to PC. In attachment is matlab program (change .txt to .m) for drawing received data to figure. (all is for PSoC 5LP)

0 Likes
Anonymous
Not applicable

Hi bob, I don´t understand.

Can I use the fftw library in a psoc project implementation??

in that case, what files do you use? because the folder fftw3 contains many files .

thank you and sorry for asking in this place.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Take a look at this for modifying coeficients -

   

 

   

    

   

          http://www.cypress.com/?app=forum&id=2232&rID=56121

   

 

   

You can also consider a comb filter, easy to implement.

   

 

   

    

   

          http://en.wikipedia.org/wiki/Comb_filter

   

 

   

You can always roll your own (bigger learning curve) using the DFB assembler -

   

 

   

    

   

         

   

http://www.cypress.com/?rID=60720     DFB Assembler, MAC Topics

   

 

   

This would allow you to implement a tunable constant Q or constant BW filter

   

of your choosing.

   

 

   

 

   

Regards, Dana.

0 Likes