digital filter using pic micro controller
I was wondering if anybody knows how i could build a digital filter using a pic microcontroller. sombody sugested it to me and i need all the help i can get. i was requested to use the 16f877 and a frequency to voltage converter at the input of the pic.
Also can anyone tell me about the LM 311N ic. I am also working with a limited budget and time. This has to be completed by the end of April so components have to be readily available.
Is this a lo-fi proof-of-concept kind of thing for a class?
No, this project is actually my final year design project for electronic engineering. this is the last credit i need to obtain my diploma.
What sort of digital filter are you trying to build? With a given input, what will the output be?
More information would be useful.
You can do FFT on the PIC to save using a frequency to voltage converter on the input (do they only work on a single frequency? if so, they're not suitable for audio). There's an app note on Microchip's site.
You can find info on the LM311 on the web. Type it into Google and have a read.
(man, if I asked these questions at uni, I'd get my *** kicked - and I'm only in second year :-) )
If you want to do audio filtering (HIFI), just forget it.
Or you may want to use the PIC18 series (the DSPIC's)
Your I2S data, most probably, will enter your PIC with a WS of 44.1 KHz and a BCLK of 2.822 MHz.
This is serial, so you have to get in all 16 or 32 bits.
This does not leave much of processing i think when running a PIC at 20MHz.
At speach bandwidth (8khz) it is a different story.
hey guys, sorry about the post but its my first time.
The entire project is to build an audio amplifier +/- 50W RMS using MOSFETS. It must also include a digital filter using a micro-controller. I have the amplifier part of it sorted out but i am not sure how to build the filter and interface it to the amp.
the filter will have to be bandpass, the input to the filter will be 20Hz to 20kHz. the output will have to be some where around 30Hz to 17kHz. As for the DSPics, they are not yet available in my country.
The microchip specialist i spoke to told me to use the 16f877 and i should use the freq/volt. converter to interface the audio signal into the PIC. He also said that the d/a coverter on the PIC would only make it harder for me.
Is this a good idea or can i make it simpler to do.
thanks for all the help.
It seems that there are a number of straightforward ways of approaching this, none of which are likely to acheive any form of quality. I think your project definition is also extremely vague, at least for us forum readers. Is your project to be
line lvl analog -> black box -> line lvl analog -> amp
where the black box does the filtering in the digital domain? Why in the digital domain? Does your project plan specify flat phase response or some other quality which is difficult to achieve via active or passive filtering?
The most rational way of doing this digitally in the real world would be ADC -> TAS3001 -> DAC mediated by your uC. Probably not hi-fi, but fairly good quality. I doubt this meets the requirements of your project to show some signal processing work though.
Another option is to pick up a board like TI's c6000 series DSP eval boards. This has an on board codec (only 11kHz/16 bit-ugh) and there is free development software that could be used to create the signal processing routines. Or you could go with a SHARC but I am not familiar with these processors.
You are hoping to complete your senior design project in 2 months? I wish you the best of luck.
If i can come up with the name i will send it to you.
This company makes tine DSP's which are very suitbale for you needs.
The have 1K of program memory and i believe the assembler and download tool are for free.
Other suggestion :
try an fpga/EPLD.
checking the requirements more carefully...
Digital filter using a microcontroller - that's pretty specific. And you need pretty beefy microcontrollers if you want to achieve any sort of quality. If I were you, I'd go out and buy or order one of everything that you can get your hands on, and figure out what you're going to do with them later.
Have you ever programmed a PIC before? The architecture is somewhat different to most microcontrollers. Some people feel that they're very restrictive. (I learnt PIC assembly before any other type, so I feel that PIC is very efficient, but everything else is very flexible :) )
If you find that your PIC has enough power, your project sounds like it would be done by FFT'ing the input (using one of the PIC ADC channels - only 8-10 bit, though), zeroing out the frequency bands outside the desired range, and converting back to the time domain (I'm not sure if the same FFT algorithm will do that - I failed Signals and Systems, damnit!)
I seriously doubt that any non-DSPIC will have enough grunt for that, though. Or give you enough frequency bands to be useful, for that matter.
A frequency to voltage converter is no good if you want, say, music signals to be legible at the output. You could move the frequency threshold continuously to achieve a really dodgy fourier transform, but the F-V converter needs a certain amount of time to do its job, and the signal will change over that period. It'll sound bad, to put it simply, if it works at all.
A single sinewave would probably be OK, though.
The ADC converter on the PIC is about as simple to use as you can possibly make it. Apply analog voltage on pin X, read digital representation on memory address Y. It's what happens after that which will be the challenge.
Should you figure out what you are try to do before how you are going to do it. Do you have a block diagram or specification. I think you might be up bit creek without an algorithm.
|All times are GMT. The time now is 04:28 PM.|
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2015 DragonByte Technologies Ltd.
Copyright ©1999-2015 diyAudio