Topics Topics Edit Profile Profile Help/Instructions Help Member List Member List  
Search Last 1|3|7 Days Search Search Tree View Tree View  

How can I compare two frequencies?

:: EPE Chat Zone ­:: ­Radio Bygones Message Board :: » EPE Chat Zone » Archive through 09 August, 2017 » How can I compare two frequencies? « Previous Next »

  Thread Last Poster Posts Pages Last Post
  ClosedClosed: New threads not accepted on this page        

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

istedman
Frequent Contributor
Username: istedman

Post Number: 434
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 16 July, 2017 - 11:34 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hi,

I've hit a block trying to accomplish something that seemed easy. How can I compare two frequency sources?

One source is an accurate 100KHz reference, using the EPE frequency reference from August 2002, the other source is a DDS module, configured to output 100KHz.

A 4046 PLL will adjust the output based on the VCO feedback to a reference but I could not see how to make it compare two frequencies. They will not be phase aligned, thus upsetting some phase comparator circuits.

Open to ideas.
Top of pagePrevious messageNext messageBottom of page Link to this message

mark_r_abcd
Frequent Contributor
Username: mark_r_abcd

Post Number: 53
Registered: 09-2012

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 18 July, 2017 - 11:14 am:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

If your signals are square (or can be made so with, say, a zero crossing detector), you can count edges. In principle, imagine connecting signal A to the +ve edge triggered "UP" i/p of an up/down counter, and the signal B to the "DOWN" input. The counter will count up or down at a rate proportional to the difference in frequency.

Note that short-term, the count is sensitive to phase (with identical frequencies, the counter counts between -1, 0 and +1 with the time spent in each state dependent on phase), but the up/down "drift" does not depend on phase or mark-space ratio.

If you only need a higher/lower indication then you can replace the counter with a "mostly ups"/"mostly downs" detector which you can do with a few flip-flops (this is sort of what the 4046 phase detector 2 does, but annoyingly for you it includes state transitions designed to make it phase sensitive). Be careful googling for circuits; some of the simpler ones will assume no phase shift and/or 1:1 mark:space ratio.

I think at 100kHz, you could use a small micro to do the counting and make it into a software problem.
Top of pagePrevious messageNext messageBottom of page Link to this message

hackinblack
Frequent Contributor
Username: hackinblack

Post Number: 796
Registered: 09-2006

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2017 - 10:24 am:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

i'm not sure if you mean building hardware to do this,or just testing the output frequencies?
if it's the latter;use the pricipal of a 'beat' frequency.
combine the 2 signals and spectrum analyse them to check for the signal peaks;the highest are the fundamantals which should,if the fequencies are very close,peak almost on top of one another.
any other peaks are difference frequencies,and harmonics (both of which are unwanted)

still playing with the Oshonsoft Pen-Gen?
my scope readings wafted about somewhat;maybe a glitch as the PIC jumps off the end of its loop into a new one?
Top of pagePrevious messageNext messageBottom of page Link to this message

atferrari
Frequent Contributor
Username: atferrari

Post Number: 1796
Registered: 05-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2017 - 10:43 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

My Owon scope allows to see both signals stable on the screen using independent trigger. Maybe that could allow comparing them.

Measuring each one is not enough to later compare?

Are you looking for a ratio or...?
Agustín Tomás - Buenos Aires - Argentina
Top of pagePrevious messageNext messageBottom of page Link to this message

atferrari
Frequent Contributor
Username: atferrari

Post Number: 1797
Registered: 05-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 19 July, 2017 - 10:50 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

My Owon scope allows to see both signals stable on the screen using independent trigger. Maybe that could allow comparing them.

Measuring each one is not enough to later compare?


Are you looking for a ratio or...?
Agustín Tomás - Buenos Aires - Argentina
Top of pagePrevious messageNext messageBottom of page Link to this message

bowden_p
Frequent Contributor
Username: bowden_p

Post Number: 578
Registered: 01-2006

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 20 July, 2017 - 05:27 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hi Ian,
If you just need a quick way to adjust the DDS signal to your reference for calibration purposes, trigger a 'scope externally from the reference, and observe the DDS signal on the screen. A small difference will result in the DDS signal "drifting" to the left if higher, and to the right if lower in frequency. This method is a bit prone to interpretation and time-base settings, but 2 signals of the exact same frequency will result in no drift regardless of the time-base setting.

Using a PIC micro and software, you could count the reference for 50,000 cycles using an IOC based interrupt, and feed the DDS signal into Timer1 clock. Determine the difference and indicate the result - greater than/less than - on LEDs, or maybe write the numerical result to an LCD.

With regards, Paul.
Top of pagePrevious messageNext messageBottom of page Link to this message

istedman
Frequent Contributor
Username: istedman

Post Number: 435
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 20 July, 2017 - 11:44 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hi,

I'll try and reply to you all in one post to save typing.

@mark_r_abcd

The DDS module has a fast comparator on chip so I have two 3.3V LVTTL square waves I can process. I like the idea of counters for "Up/Down" shifting. Might not need this after a quick experiment tonight though.

@bowden_p

I tried your suggestion with some success. With a 100KHz output, I had trouble getting the two signals to align. At 10KHz, I found the DDS module and my reference were within 1Hz of each other, impressive accuracy, if my scope is to be believed.

If the two sources are within 1Hz, maybe I don't need to calibrate every power up, could make it annual and apply a correction in software during the calibration process.

@hackinblack

I'm looking to house the DDS module + Arduino and the EPE frequency reference in one case. The idea was I could self calibrate the DDS frequency on power up. I can calibrate and measure the output amplitude at low frequency as I'm also adding adjustable amplitude.

I don't think the FFT function will give me the resolution, the frequency bins are something like 56Hz. Following the suggestion from bowden_p it looks like the difference is 1-2 Hz, the FFT would not see this.

I have not played with the Oshonsoft Pen-gen for a bit. If you want me to try a new design, send me the files location and if you can provide a hex file for the 10F202, it save me re-building it.

@atferrari

I'm not 100% sure of the accuracy of my oscilloscope. With the 100KHz signal, the resolution is 100.x KHz where x is increments of 100Hz, I'm looking for accuracy of a few Hz.

Scope counter accuracy are normally quite good, I should check what my 10 year old Agilent scope can do.

@thread

I might be over engineering the system, I'm trying to see what accuracy and resolution I can achieve. It's fun.

Have been meaning to experiment with PLLs for a while, this project has been good to learn. I've used PLLs in high speed serial links but have not used the phase comparator functions directly, that has been educational.

Thank you for your suggestions and help guys.

Ian

Administration Administration Log Out Log Out   Previous Page Previous Page Next Page Next Page