QAudioInput Frequency and Amplitude
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
Re: QAudioInput Frequency and Amplitude
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, ...)
Re: QAudioInput Frequency and Amplitude
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
Re: QAudioInput Frequency and Amplitude
Very likely this is because of characteristic of your hardware audio input. Do you use line-in or microphone input?
Re: QAudioInput Frequency and Amplitude
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.