## Frequency a simple question !

Ask any questions about using the new PicoScope 7 Automotive software here.
picowight
TwoWaves
Posts: 91
Joined: Sat Oct 26, 2019 6:45 pm

### Frequency a simple question !

Simple question but not been able to find the answer.
How does Picoscope calculate the frequency?
So if a wave oscillates around zero that's easy. But what about a hall effect sensor where say it is say 0.5 - 4.5 v does Pico take the average amplitude/2 and count the passes of that mid point ?
The reason I ask is I was looking at a hall effect sensor with a lot of noise on it, so I put the maths channel on expecting to have to do something like freq(A-2.5) to have it cross zero - however that was not needed.
I wanted to know as I wanted to see on the plot if the ECU was likely seeing bad data due to the noise.

liviu2004
TwoWaves
Posts: 419
Joined: Sat Mar 19, 2016 8:23 am
Location: Netherlands

### Re: Frequency a simple question !

How about removing the dc component of the signal, in software? Engine ecus do that as well.

Steve Smith
Pico Staff Member
Posts: 1311
Joined: Sun Aug 25, 2013 7:22 am

### Re: Frequency a simple question !

Hello and thank you for the post

Regarding frequency calculations (using math channels) PicoScope is looking for repetition and will auto detect the cycle threshold & cycle hysteresis based on these results.

To give you an example, if we return to PicoScope 6 Automotive and “Deep Measure” here viewtopic.php?p=93651#p93651 you can see this auto detect feature in action which accommodates for a PWM signal above 0 V with varying degrees of noise
Image 1
Above, PicoScope has detected the optimal cycle threshold to be 5.346 V and this is the same principle utiilsed by the frequency math channel

There was a time when D-2.5 would have been required to allow for the detection of the cycle threshold about 0 V but thanks to the software teams, not any more (It will still work on the above waveform though)

Below we confirm the cycle time displayed in the Deep Measure table matches the freq(D) math channel
Image 2
Above cycle time = 5 ms (approx.)
Hz = Cycles per second
1000 ms in 1 second
1000 / 5 = 200 cycles per second (200 Hz)

Frequency via Deep Measure table = 200 Hz Approx. (based on a single cycle time)
Frequency via Math Channel = 196.7 Hz Approx. (based on signal ruler centered about math channel)
Frequency via Ruler legend = 199.7 Hz Approx. (based on time rulers measuring a single cycle)

I hope this helps, take care……Steve

N.B. Deep Measure will soon be included within PicoScope 7 Automotive software

picowight
TwoWaves
Posts: 91
Joined: Sat Oct 26, 2019 6:45 pm

### Re: Frequency a simple question !

Thanks Steve, glad it was not a daft question - I did search but didn't find anything.
PS does basically what a human would do, look at the top and bottom, ignore the noise and pick a middle to count frequency.
That's great, now I know it's there I can not worry about it. It is such a good tool to find anomalies and interpret
speed from a VR sensor where the increasing amplitude can fool the eye.

PatL
OneWave
Posts: 18
Joined: Wed Dec 26, 2012 4:09 pm

### Re: Frequency a simple question !

I was trying to read frequency (in Pico 7) the other day on a saved file and it was reporting differing values as I spread the time cursors apart. Can it be used on a saved file or is it only real time measurement? Maybe I am doing something wrong.

Steve Smith
Pico Staff Member
Posts: 1311
Joined: Sun Aug 25, 2013 7:22 am

### Re: Frequency a simple question !

Hello and thank you for the post

You can measure “Frequency” on saved capture or during a live “real-time measurement"

However, if you are measuring frequency using the Time Rulers, the Ruler legend will display 1/Delta value
between the time rulers.

This is why your frequency value will change when moving the time rulers closer together (higher frequency) or further apart (lower frequency)

The “Delta” value is the difference between Time Ruler 1 and 2 and denoted by the symbol Δ

If Time Ruler 1 is placed at 1 second, and Time Ruler 2 at 5 seconds into your capture, the Delta (Δ) will be 5-1 = 4 seconds

To find the frequency value with respect to “Time” we use 1/Δ
1 / 4 = 0.25 Hz

If our time rulers had been placed closer together with just a Delta value of 0.5 seconds then the frequency would be:
1 / 0.5 = 2 Hz

Below is an example using CAN at 500 kbs
Image 1
Note how Scope view 1 has the time rulers placed so as to measure the smallest CAN bit in a CAN frame (to find the baud rate)

The Delta value is almost 2 µs
1 / 0.000002 seconds = 500,000 Hz or 500 kHz
Image 2
Now look at Scope view 2 where the Delta between the Time Rulers is 214.2 µs
1 / 0.0002142 seconds = 4.668 kHz

I can see how using the Time Rulers to denote Frequency may have led to confusion when looking at an entire waveform.

The examples above hopefully demonstrate how the Time Rulers can be used when focusing on a single cycle within an entire waveform

I hope this helps, take care…….Steve

PatL
OneWave
Posts: 18
Joined: Wed Dec 26, 2012 4:09 pm

### Re: Frequency a simple question !

Steve,
Thanks or the explanation of how Pico reports frequency. I was using it in a wave form and was anticipating that it would report the the number of waveform cycles between the time rulers and divide by the time between the rulers. (counts/second). From your explanation, if I am interpreting it correctly, Pico assumes you have placed the time cursors on a single and it simply does the 1/delta time calculation to report frequency. Is there a way to have Pico report the counts between ruler time delta?
Pat

Steve Smith
Pico Staff Member
Posts: 1311
Joined: Sun Aug 25, 2013 7:22 am

### Re: Frequency a simple question !

Hello Pat, thank you for the feedback

Within PS7 we have the "Edge count" options in the measurements panel

Below I have opted for "Edge count" which includes both rising and falling edges, followed by just rising and just falling edges
Image 1
Remember, if you require Edge counts between signal rulers, click on the measurement lozenge and select between rulers (See below)
Image 2
This feature will provide you with cycle counts assuming your edges upon which we count are not influenced by noise. (Here you can apply the low pass filter option)

Deep Measure would also provide you this information which will is scheduled for PS7 but for now, PS6 will cover you here

I hope this helps, take care......Steve

PatL
OneWave
Posts: 18
Joined: Wed Dec 26, 2012 4:09 pm

### Re: Frequency a simple question !

Yes, this provides what I was looking for. Thank you.
Pat