electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

audio application using PIC??? CLUELESS


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> audio application using PIC??? CLUELESS
Author Message
ae_13



Joined: 25 Mar 2009
Posts: 7


Post25 Mar 2009 16:22   

audio application using PIC??? CLUELESS


hey guys,
im kinda new at this, im trying to program a 16F877A PIC microcontroller to recognize specific audio frequencies at certain time intervals - for example, 300Hz at 0 sec, 545Hz at 2 sec, 1231Hz at 5 sec, 300Hz at 7 sec and the loop goes on.. of course the audio input is supposed to be through a microphone or two
now herez my problem, i've read a whole bunch of tutorials on programming PICs, but i havent found what i seek
i need to find a way to recognize these frequencies (the audio is supposed to be like a pattern/tone with lets a max freq of <1500Hz and a min freq of 250Hz) - in quite a noisy environment
i'd like to know if im usung the correct PIC or should i go to the dsPIC series or the 17C series????
could anyone help?? coz as u can see, im TOTALLY lost Crying or Very sad
Back to top
saeed_pk



Joined: 20 May 2006
Posts: 199
Helped: 5
Location: Islamabad, Pakistan


Post26 Mar 2009 15:44   

Re: audio application using PIC??? CLUELESS


You are facing a DSP problrm you should switch to dsPIC if you ca have it
All you need to do is
-> Sample Audio Frequency Separate it using FFT which can tell you majority frequency of your signal you can cancel noise by under sampling / Sample @ the slightly greater then the twice of the maximum frequency contained in your signal
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5177
Helped: 769
Location: Bochum, Germany


Post26 Mar 2009 16:18   

audio application using PIC??? CLUELESS


using dsPIC is basically a good idea, although I fear, it doesn't already solve the being CLUELESS problem. As an advantage, Microchip has a rich choice of DSP reference applications that can help you to acquire the specific knowledge.

But for limited requirements, I think a PIC16 can do it, too. In this case, the frequency selection must be achieved by very basic IIR or FIR filters, almost avoiding multiply operations. Depends of course on the intended selectivity and available SNR.
Back to top
Google
AdSense
Google Adsense




Post26 Mar 2009 16:18   

Ads




Back to top
ae_13



Joined: 25 Mar 2009
Posts: 7


Post26 Mar 2009 17:54   

audio application using PIC??? CLUELESS


thnX guys for your feedback
my problem is that im new to PICs :S
therefore i am CLUELESS Razz
otherwise i am ok with learning (if its possible within 2 weeks or so)
ummm.. so there is no other way to obtain frequency besides using the FIR or FFT???
ci dont want to be using complex codes and complex libraries if i could use something more simple

another question..
is there any way i could link the dsp libraries to matlab so i can do the functions on matlab then send them to the PIC??
thnX for ur help guys Smile
Back to top
blueroomelectronics



Joined: 17 Sep 2006
Posts: 1681
Helped: 99
Location: Toronto, Canada


Post27 Mar 2009 4:26   

audio application using PIC??? CLUELESS


You have a complex problem and you'll need a DSP.

How long till it's due?
Back to top
ae_13



Joined: 25 Mar 2009
Posts: 7


Post27 Mar 2009 12:09   

audio application using PIC??? CLUELESS


like 2 months or so.. maximum til 1st of june :S
Back to top
blueroomelectronics



Joined: 17 Sep 2006
Posts: 1681
Helped: 99
Location: Toronto, Canada


Post27 Mar 2009 15:43   

audio application using PIC??? CLUELESS


Unless you're a real good PIC C30 programmer and you've got the hardware designed you have a very slim chance of making your June 1 deadline.
Back to top
ae_13



Joined: 25 Mar 2009
Posts: 7


Post29 Mar 2009 16:48   

audio application using PIC??? CLUELESS


any tips, any words of advice?
any suggestions?
where to start? what to use????
im good at programming C, the hardware design shouldnt be much of an issue.. but the method!!
should i use the dsPIC33, apply FFT, then idk using some method try to capture the specific frequency?
is it as simple as it sounds - programming-wise????
its necessary that i hit it be4 the deadline :S
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5177
Helped: 769
Location: Bochum, Germany


Post29 Mar 2009 18:17   

Re: audio application using PIC??? CLUELESS


I guess, it's something like a final years project. As a first point, I wonder if you don't have any support from your instructor.

As a second point, I miss a clear specification of the problem and I wonder if you know it at all?

It didn't come clear yet, if you have to choose a hardware platform or if it has been already selected. Also if the project focus is on DSP algorithms and software, using an existing hardware, e.g. a Microchip evaluation board. Or if you also are in charge of designing a hardware?

You mentioned a noisy enviroment, but didn't tell about required frequency selectivity and response time. Also a quantitative signal-to-noise specification would be good. Generally the complete detection part (DSP algorithms) can be evaluated by software tools on a PC, without building a hardware or processor specific programming. It would allow to determine the numerical effort and select a suitable platform.

On the other hand, it won't harm to learn about the said dsPIC DSP application examples and to understand if their complexity fits the project time budget.
Back to top
ae_13



Joined: 25 Mar 2009
Posts: 7


Post29 Mar 2009 19:51   

audio application using PIC??? CLUELESS


ok lemme start it over again
im supposed to recognize a certain audio signal through the mic that is connected to the PIC
now, lets assume that the audio signal is a siren
and to detect this siren signal... i assumed that i must detect it by checking its frequncy/frequncies
i propose checking the min and max frequnceies and inserting a delay in between
now the freq range is between 500Hz and 1200Hz, so i thought of checking for the 500Hz signal, wait for 2 secs (the time required til the max freq is supposed to be detected) then check whether the maximum frequency has been detected or now

so thats basically the specification of my problem
as for my instructor, his field is in DSP and signal processing.. etc

and yes it is a graduation project.. if u care to know
thats y i have a strict deadline and i need to solve my problem ASAP

any help or guidance is appreciated
thnX
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5177
Helped: 769
Location: Bochum, Germany


Post29 Mar 2009 21:45   

Re: audio application using PIC??? CLUELESS


Thanks for the clarification. Although it may seem rather clear on first look, the basic DSP specification (and that's the critical part of the project to my opinion) is still very vague. Why?

Please consider two cases. The sirene tone may be dominant in the sound input. In this case, the problem is very easy. A simple frequency or period measurement would derive the momentary frequency, or with slightly more noise, a function similar to a tone decoder can show a hit at certain frequencies. You can consult some of the various guitar tuner projects on the internet as example of solutions that work with a dominant tone.

The contrary case is a sirene almost hidden in noise. It can be percepted by the human ear only due to it's specific frequency modulation. A DSP instrument basically can do the same, but not by checking a frequency at singular moments. It must follow the modulation to decide, if it's a sirene.

Cause you previously mentioned a noisy enviroment, I assume that your problem is located somewhere betweeen these two cases. But to start a project, you have to know the location at a SNR scale. As another issue, other tone-like sound signals may be present, e.g. music. How much selectivity is intended in this regard.

P.S.: If the project way is by using a predefined DSP method and you have to do the software and hardware implementation, than it may be appropriate to choose a dsPIC with sufficient program and data memory and try to command the toolchain, possibly starting with some DSP related Microchip design examples.
Back to top
ae_13



Joined: 25 Mar 2009
Posts: 7


Post29 Mar 2009 21:57   

audio application using PIC??? CLUELESS


i was thinking of using the dsPIC to convert from time domain to frequency domain via FFT??

the environment for the time being is not as important.. because the point is that i can run it under testing conditions.. so im sticking to the first case

i hope i havent left anything vague
once again thanks for your feedback and interest
i truly appreciate it
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5177
Helped: 769
Location: Bochum, Germany


Post29 Mar 2009 22:40   

Re: audio application using PIC??? CLUELESS


I wanted to figure out, if you are application is intended to go to the detection limits or taking a rather easy way. Regarding FFT, it's a universal method of course. In your project, you have to detect the varying frequency of a single tone. The most simple way in frequency domain is to detect a maximum and possibly, that's high enough above the background level (noise). But this operation can be achieved by PLL tone decoders or a combined frequency and level measurement in bandpass filtered channels as well.

If your project is obligated to use FFT for any reason, it will surely work. But I don't think that's the most simple way. The said guitar tuners have been build with a PIC16 or PIC18 as well.
Back to top
ae_13



Joined: 25 Mar 2009
Posts: 7


Post30 Mar 2009 15:00   

audio application using PIC??? CLUELESS


well thanks for the clear reply, but im not restricted to FFT, i prefer to use it for my project because i am a computer engineering student, i think PLL and filters would categorize under the electronics/communications engineering


audio application using PIC??? CLUELESS


as u can see in the attached image, this is a specrtum analysis for the siren audio signal, where the minimum frequency is around 500Hz and the max is around 1200Hz
therefore, as u mentioned, i am going to check the upper and lower frequency limits of this audio signal for simplicity
my question is, would there be an easier way to determine the upper and lower limits of the siren signal using the PIC, besides FFT, lets say, CCP module or ECCP?
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5177
Helped: 769
Location: Bochum, Germany


Post30 Mar 2009 18:17   

audio application using PIC??? CLUELESS


The fundamental looks rather strong, a direct frequency measurement should be possible.
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> audio application using PIC??? CLUELESS
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
Project CDROM AUDIO Controller using PIC (20)
filter for audio/video application (2)
clueless girl needs help! (11)
how to design power amplifier in audio application? (3)
About audio DAC for headphone application (2)
Which is the best AD-DA for pro Audio application (1)
architecture of sigma delta ADC/DAC for audio application? (7)
pic with industrial application (2)
AVR & PIC Products Application ? (1)
usb pic and wireless application (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS