Capture analog input frequency of any amplitude and output same frequency at set amplitude

Papabravo

Joined Feb 24, 2006
22,115
Hi All,

Thanks for the comments.

Firstly, A.G, that device is a crime against music :)

So what I have,

A computer outputting a test signal that's a reasonably clean sine wave (not perfect), but very hard to adjust the amplitude accurately (and impossible to get to my required 2.83V RMS)
The signal goes from 10hz to 25khz (or 30khz if you set it) in around 1.25 seconds. Amplitude variations are minimal during that time. I'd really like it to be near zero for accurate measurements.

I understand I could probably buy something that could do the testing job for me, but I am trying to learn and like building my own stuff as solutions. I was a mechanical engineer and currently a software engineer. My electronics is sketchy and I've only done analog with valves to far.

Cheers

Si
Are you saying that the signal, a basic sinewave, is "swept in frequency" from 10Hz to 25kHz in 1.25 seconds and making the amplitude adjustment during that period is proving...ah challenging. Yeah , challenging, that's the ticket. It is almost like what you want is for the generator to come on at some "test" frequency, where you adjust the amplitude, via an auto tuning mechanism, and then you proceed to do the measurement sweeps. That certainly is different from what I imagined from you initial description.

I suppose you could also make the adjustment if the computer would sweep both up and down continuously while you adjusted the amplitude. As long as we are dealing with sinusoidal signals, it should be enough to adjust the peak amplitude to 4 volts (2.83 VRMS * SQRT(2)).
 

Thread Starter

simondavidkelly

Joined Nov 12, 2009
13
Are you saying that the signal, a basic sinewave, is "swept in frequency" from 10Hz to 25kHz in 1.25 seconds and making the amplitude adjustment during that period is proving...ah challenging. Yeah , challenging, that's the ticket.
Not quite: impossible rather than challenging. The granulation of the adjustment is not fine enough to hit the required amplitude. It's either low or high. 0.04V (ish) either side.

It is almost like what you want is for the generator to come on at some "test" frequency, where you adjust the amplitude, via an auto tuning mechanism, and then you proceed to do the measurement sweeps. That certainly is different from what I imagined from you initial description.
Not quite. I would like the frequency of the computers output to simply be transferred to the fixed output of the "device". I would rather not have to do manual adjustment at all.

The only way I can describe what I want it to do is put a perfect 1 Watt out regardless of wattage of the input signal.
 

WBahn

Joined Mar 31, 2012
33,315
What are your tolerances? You now throw out that 0.04 V to high or too low isn't good enough. Well, what IS good enough.

What do you consider to be "a perfect 1 Watt out"? Since 1.000000000004 W is not a perfect 1 W, I guess that would be unacceptable.

You said that you were a mechanical engineer. If a customer came to you and said that they needed the length of some component to be a perfect 2.83" long, what would you have told them?
 

Thread Starter

simondavidkelly

Joined Nov 12, 2009
13
What are your tolerances? You now throw out that 0.04 V to high or too low isn't good enough. Well, what IS good enough.
2.83V +/- .005

What do you consider to be "a perfect 1 Watt out"? Since 1.000000000004 W is not a perfect 1 W, I guess that would be unacceptable.
Only to pedants.

You said that you were a mechanical engineer. If a customer came to you and said that they needed the length of some component to be a perfect 2.83" long, what would you have told them?
Had loads of people give me that kind of quote. It's easy to define as 2.83 -0.005/+0.004. If you round the result and get the requested number they cannot complain.
 

AnalogKid

Joined Aug 1, 2013
12,287
You are asking for an AGC circuit with relatively large bandwidth and a correction range of 70 dB. That's hard. 30 kHz at a gain of 2830 is a gain-bandwidth product of 85 MHz. That is beyond hard. Are you sure about that 1 mV part?

Also, you are asking for an output flatness across bandwidth of 0.0014 dB. Again, hard.

BTW, way to bury the lead. It took only 23 posts for you to at least *imply* what it is you are trying to do.

ak
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,287
The signal goes from 10hz to 25khz (or 30khz if you set it) in around 1.25 seconds. Amplitude variations are minimal during that time. I'd really like it to be near zero for accurate measurements.
Is the swept frequency linear or logarithmic? Wait - it doesn't matter. AGC systems with anything near the adjustment range you want are closed-loop systems. The output is rectified, filtered, and peak detected, and that peak voltage value is used to modulate the input such that the output peak value equals the desired value. That takes time. Three cycles of 10 Hz takes 0.3 s, out of your total sweep time of 1.25 s, and three cycles probably is not enough time for the filter output to stabilize. Ripple in the filter output appears in the output waveform, but the better the filter (lower ripple), the greater the time delay (overshoot/undershoot in the output envelope shape).

Note, another option is control based on the output's RMS value (as opposed to its peak value). This adds another time delay to the correction loop. RMS-based AGC is better for a complex waveform like speech or music, but unnecessary if the input is a reasonable-quality sinewave.

ak
 

MisterBill2

Joined Jan 23, 2018
28,502
OK, so now we understand that the signal is a computer generated frequency sweep that is done fairly rapidly. In fact, that is very fast indeed. So the first question is if the signal as it is now is an adequately pure sine wave, or does it need cleaning up? If the signal is good enough as is, then the solution would be to have a very low distortion amplifier followed by a voltage controlled attenuater using amplitude feedback to keep the level constant. The really big challenge would be the response time of the feedback loop.
A second option may be to invest in a better sound card to generate the signal.
A third option would be better software to drive the signal generation circuit, because it does seem like it is ultimately a software issue.
 

MisterBill2

Joined Jan 23, 2018
28,502
As for the required accuracy, to have 2.83 -0.005/+0.004. as a spec is not correct. It would be 2.830 and the allowable variation stated. And I can see that the granularity of the setting can be a big problem. So one solution could be different software with the same hardware, so that the amplitude can be more accurately specified.
If you are willing to do some experimenting I suggest seeing if slowing the sweep rate provides an improvement.
I am also wondering about the purpose of this signal. It is way too fast for most frequency response tests, especially of any mechanical system. So can the TS clarify what the purpose or application really is?
 

Ian0

Joined Aug 7, 2020
13,310
A second option may be to invest in a better sound card to generate the signal.
A third option would be better software to drive the signal generation circuit, because it does seem like it is ultimately a software issue.
I’d second that. You could get really proficient in frustration trying to get that device to work.
I got an app for my iPad called Function Generator Pro which is easy to use, and is as good as Apple highly regarded headphone DAC,
See www.kenrockwell.com/apple/lightning-adaptor-audio-quality.html
and of course, will drive a 32ohm load. I think it has only 1V rms output, but a x2.83 circuit on an op-amp shouldn’t challenge you that much.
I can think of much better applications on which to learn analogue signal processing than trying to ”improve” a dubious audio card.
 

AnalogKid

Joined Aug 1, 2013
12,287
The application clearly is audio-ish. My guess is speaker or microphone evaluation / qualification / testing, like qualifying variations of a new design to see how they affect efficacy.

ak
 

Audioguru again

Joined Oct 21, 2019
6,826
Years ago I had trouble testing speakers frequency responses because of echoes. I did not have a non-echoic chamber so I put the speaker down on its back outdoors away from echoes and hung the mic from a tree branch above it.

I also had trouble making a frequency sweep keeping the level constant so I ended up using accurate pink noise to produce 20Hz to 20kHz.
 
Last edited:

Ian0

Joined Aug 7, 2020
13,310
A lot of speaker frequency Response graphs are produced from the Fourier transform of the impulse response.
 

MisterBill2

Joined Jan 23, 2018
28,502
That frequency sweep speed, "The signal goes from 10hz to 25khz (or 30khz if you set it) in around 1.25 seconds " is way too fast for most audio testing. it would be closer to a chirped sonar signal if it did not start out so low. So it is not an acoustic audio test, I don't think. Possibly driving some sort of spectrum analysis system, maybe.
But here we are guessing.
 

WBahn

Joined Mar 31, 2012
33,315
2.83V +/- .005



Only to pedants.



Had loads of people give me that kind of quote. It's easy to define as 2.83 -0.005/+0.004. If you round the result and get the requested number they cannot complain.
So, by YOUR OWN RULES, since you asked for a perfect 1 W, it's easy to define as 1 -0.5/+0.4 W since, if you round the result you get the requested number. Therefore, by your own rules, you can't complain about anything between about 2 Vrms and 3.34 Vrms.

Notice that YOU were the one that made the point of adding the word "perfect" to your desired output of 1 W. Why? What was the "perfect" qualifier supposed to convey? If it has no meaning if someone asks for a perfect 2.83", then it can't have any meaning when you ask for a perfect 1 W.
 
Top