Results 1 to 5 of 5

Thread: QAudioInput Frequency and Amplitude

  1. #1

    Post 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

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default 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, ...)

  3. #3

    Default 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

  4. #4
    Join Date
    Jan 2010
    Location
    Poland Warsaw
    Posts
    25
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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?

  5. #5
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default 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.

Similar Threads

  1. QAudioInput example strange behavior
    By m15ch4 in forum Qt Programming
    Replies: 0
    Last Post: 13th August 2010, 07:55
  2. Frequency of Audio Track
    By vijay_kansal in forum Qt Programming
    Replies: 5
    Last Post: 28th July 2010, 11:15
  3. QAudioInput and QtcpSocket help!!!
    By XavierQT in forum General Programming
    Replies: 1
    Last Post: 13th July 2010, 20:15
  4. Frequency of sound data
    By momesana in forum General Programming
    Replies: 1
    Last Post: 10th May 2010, 23:21
  5. Replies: 0
    Last Post: 21st January 2010, 15:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.