Analyzing single waveform for frequency over time?

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
timg11
Posts: 3
Joined: Sat Feb 27, 2021 5:05 pm
Operating System: Windows 10

Analyzing single waveform for frequency over time?

Post by timg11 » Sat Feb 27, 2021 5:18 pm

I have sample data that consists of a single waveform - effectively a square wave of varying frequency.

I'd like to analyze it and export the frequency value over time as another waveform that can be plotted.

I have reviewed the Plot Spectrum that works over the currently selected samples.
Possibly my overall objective could be accomplished by using the Audacity Scripting to select a region of samples (short in comparison with the variation in frequency), Plot Spectrum, Identify peak/fundamental, export that value, increment the selection region, and repeat.

I've never used the scripting plugin in Audacity, so that would take some study.

Another way to accomplish the goal would be to measure the time (in samples) between successive rising edge zero crossings in the waveform, and calculate the instantaneous frequency.
Does Audacity have any analysis features (or are the plugins) that work in this manner?

Or is there a different approach that would be more easily accomplished?

steve
Site Admin
Posts: 81218
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Analyzing single waveform for frequency over time?

Post by steve » Sat Feb 27, 2021 6:08 pm

What's the purpose?
If you want to "see" the change in frequencies over time, then that's what the track spectrogram view does: https://manual.audacityteam.org/man/spe ... _view.html

If you need to do some numeric analysis, then you will need a different solution, which begs the question, what exactly do you need? What is "the goal"?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

timg11
Posts: 3
Joined: Sat Feb 27, 2021 5:05 pm
Operating System: Windows 10

Re: Analyzing single waveform for frequency over time?

Post by timg11 » Sat Feb 27, 2021 7:22 pm

@steve, thanks - I was unaware of the track spectrogram function - I only explored the menus.

The application is troubleshooting a 40 year old analog/digital hybrid synthesizer. There is a mailing list but it is apparently email-only. I cannot find a web view that I could link to my posts.

In summary, the instrument has a "self test" that is failing voice boards that appear to work properly when tested separately (in an external test jig). The waveform is a indirect indication of the activity of the self test that is conducted by the embedded CPU. Comparing differences in the frequency changes between passing and failing boards is hoped to reveal the operation (and more importantly mis-operation) of the self test, and narrow down the specific aspects that are causing the test failure.

I think the track spectrogram view is a great place to start. Depending on what I learn, I may want to look at deriving a single frequency per unit time type of measurement. Maybe there is a plugin that implements a differential function (dv/dt) that will convert the positive edges to positive values and then measure the difference in time between the positive values to get the period, and thus the frequency?

steve
Site Admin
Posts: 81218
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Analyzing single waveform for frequency over time?

Post by steve » Sat Feb 27, 2021 9:32 pm

timg11 wrote:
Sat Feb 27, 2021 7:22 pm
Maybe there is a plugin that implements a differential function (dv/dt) that will convert the positive edges to positive values and then measure the difference in time between the positive values to get the period, and thus the frequency?
I think there's a plug-in somewhere that counts zero crossings (when the waveform crosses zero). If not, it would be fairly simple to make one using Nyquist (See: https://manual.audacityteam.org/man/nyquist.html). Give a shout if you need to go down that route.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply