PDA

View Full Version : QAudioInput Frequency and Amplitude



stormtrooper5
2nd January 2011, 13:45
Hi,
I'm trying to measure the frequency of a sine given from a frequency-generator. The generator is connected to the PC via the audio-input.
I'm using a QAudioInput and a QIODevice to handle the data.
The frequency is measured by counting the zero-crossings in a defined time, this works until ~5khz.
I wonder, why the amplitude of the signal seems to lower with rising frequency:
Obove 5khz the data arriving in the QIODevice has values between 125 and 128, which makes it impossible, to count the zero-crossings correctly (It's normaly oscillating around 127).
The frequency generator does not lower the amplitude of the signal, i checked this with an oscilloscope.

Does somebody know, why QT seems to lower the amplitude?

Greetings

tbscope
2nd January 2011, 14:07
Hmm, this sounds more like a hardware problem to me. Is this an analog signal? If so, what are the details of the input card (sampling rate, bit depth, filters, ...)

stormtrooper5
2nd January 2011, 14:58
Yes, it's an analog signal.
The sound input card is the one in my notebook: Intel 82801GBM ICH7-M - High Definition Audio Controller PCI

m15ch4
22nd February 2011, 17:33
Very likely this is because of characteristic of your hardware audio input. Do you use line-in or microphone input?

SixDegrees
22nd February 2011, 18:18
Just a note - once you get your hardware issues sorted out, you might want to consider using a Fourier transform instead of counting zero crossings to obtain frequency.