My application requires a frequency sweep in a coil and measuring the resultant resonant frequency from the coil after it has settled.
I can do the second part i.e. wait and count the rising edges of say 100 samples to measure the resonant frequency but am lost when it comes to the sweep generation part.
I am looking to generate frequency sweep using AVR microcontrollers. Frequency range (selectable): starting frequency min = 500 Hz to end frequency max = 5500 Hz. Duration will be anywhere between 125-500ms (selectable).
Searching for frequency sweeps on the internet I got some ideas for a linear sweep. Basically I pick a starting frequency and step frequency size and keep generating the next frequency by adding the start frequency + step frequency and so on until I reach my end frequency. Is this the correct approach?
I am confused about generating log frequency sweep. I've got these parameters: start frequency, end frequency, sweep duration (this determines different combinations of increments (step size) and the number of half cycles for a 50% duty cycle square wave). I am only looking to generate square waves for simplicity, they don't need to be sine waves.
Basically: how do I implement frequency sweeps using AVR microcontrollers (more specifically logarithmic sweeps)?
Any ideas/pseudo code for square wave pulse sweep please?