Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to detect frequency changing with adc

Status
Not open for further replies.

hamid.abbaszadeh

Member level 3
Joined
Jan 26, 2012
Messages
63
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
iran
Activity points
1,666
hi all
i want to detect frequency between 140k and 145k.for example when signal is 140k turn on led1 and when its 141k turn on led2
 

Hi,

A lot of specification is missing:
Frequency resolution, level resolution, speed, circuit.... what is it for?

From your given data:
If your max frequency is 145kHz then you need MORE then twice than that as sample frequency.
If you want a frequency resolution of 1kHz, then you need a measurement windows of 1ms.

Let's say 400ksmpl/s. Then you need to store 400 samples and perform a Fourier analysis on the data.
You get 200 results for 0...199kHz.
Now you have to decide how to handle it.
Imagine:
* you see a value of 1000 LSBs at bin 144kHz and a value of 1000 LSBS at bin 145kHz. How to handle it?
* or you have 5 LSBs at bin 144kHz.. Is it considered as noise or as a true signal?
* and numerous other cases..

--> you need a good and detailed specification

Klaus
 

An LC tank can be a bandpass filter. However you may have to accept a wider range of response.

It is a lot to expect for it to discriminate between 140k and 141k Hz. It will be easier if you were to choose two trigger frequencies which are more widely separated.

There is also the option of counting pulses, digitally, in a frequency counter.
 

This can be possible using a PLL with Xtal and counter to match threshold frequency using CD4046 , CD4060 counter, Xtal to pick suitable threshold

Better way might be Xtal divider to 140kHz and use mixer to down convert to drive tach circuit i.e. zero-crossing to trigger 1shot and output Vavg proportion to f from 0 to 5kHz using 200us pulse. Make 1shot non retrigerable and filter signal bandpass to reject noise.

Then use LED bar driver chip with 5 Window thresholds for each threshold, eg. 0~1kHz , 1~2, 2~3,3~4,4~5 using thresholds 1,2,3,4 using Op AMps or LED bar driver chip.
 

https://obrazki.elektroda.pl/2388882000_1446372750.png

- - - Updated - - -

this is my project:
clock of adc is 1MHZ and my controller use external osc with 8Mhz frequency.i want to write one code like it .
i wanted to chek it with some signal in input.
when u give it a signal with constant frequency it code doesnt detect anythings in lcd.
when u give it dc signal too.but when i give it a signal with chaning frequency it detect and show value on lcd.
i guess in its code use fft code but with this micro and this freq sampling from lcd and this osilator how its posibble?
im extremely confuze.
 

Attachments

  • Untitled.png
    Untitled.png
    8 KB · Views: 47

I think you would find it difficult to sample and analyze a waveform to that resolution with a relatively slow ADC and micro like that. An ADC is a voltage measuring device but from your description, you really need a frequency measuring device instead. Consider using a comparator (if your signal isn't already TTL levels) and the PIC timers or CCP module to measure the frequency directly. That will give you far higher resolution with simpler hardware and software and if written carefully can even be run as a background task while the PIC does somethng else.

Brian.
 

i guess in its code use fft code but with this micro and this freq sampling from lcd and this osilator how its posibble?

The FFT function requires a lot of the uC resources and unless runing with a DSP compatible ALU, will not be able to get the result realtime.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top