Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Multimedia recording filtered to 20kHz bandwidth
Forum Updated to NodeBB v4.3 + New Features

Multimedia recording filtered to 20kHz bandwidth

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 129 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SwimRideRunCode
    wrote last edited by
    #1

    Hi,
    My use case is employing Qt Multimedia to read a FunCube dongle SDR receiver with 192kHz sample rate. I have it working OK at full bandwidth with Qt 6.5 on my Linux Mint 21 machine, but with Qt 6.9.1 and 6.5.3 on my i9 machine running Linux Mint 22.1, the audio from QMediaRecorder is cut off at 20kHz.

    The attached screenshot is from Audacity, reading a file produced by the unmodified "audiorecorder" example from QtCreator.
    I selected my FunCube Dongle as the audio source with a sample rate of 192kHz and 2 channels. The peaks
    in the spectrum are from my signal generator at 10kHz above the receiver centre frequency and with triangle wave AM modulation. Notice the sharp cutoff of the spectrum at 20kHz.

    I've spent quite some time getting to the bottom of this, and have applied suggestions such as setting both PipeWire and Alsa to "Pro Audio" mode with no success.

    Audacity is able to record from the device at full bandwidth with no problem.

    Can anyone suggest where and why this 20kHz filter is being applied despite the configured 192kHz sample rate?

    Thanks in advance.

    Screenshot from 2025-07-16 16-21-59.png

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SwimRideRunCode
      wrote last edited by SwimRideRunCode
      #2

      (N.B. The recording shows in Audacity as having a sample rate of 192000Hz)

      1 Reply Last reply
      0
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote last edited by
        #3

        Sample rate and freqency range are two different things. The sample rate will determine the fidelity of the sound. the 20khz you are refering to is most likely the frequency response since humans cannot hear above around 18khz.

        S 1 Reply Last reply
        0
        • Kent-DorfmanK Kent-Dorfman

          Sample rate and freqency range are two different things. The sample rate will determine the fidelity of the sound. the 20khz you are refering to is most likely the frequency response since humans cannot hear above around 18khz.

          S Offline
          S Offline
          SwimRideRunCode
          wrote last edited by
          #4

          @Kent-Dorfman
          There is a problem with filtering a 96kHz bandwidth signal (192kHz sampling rate) down to 20kHz bandwidth. It looks like something to do with how Qt is dealing with the drivers. Like I said, it's fine on Linux Mint 21 on my old laptop. There isn't a problem with the drivers per se because Audacity is able to record at full bandwidth from the same device.

          I've scoured the settings and documentation for something that might be relevant, and made every suggested adjustment. Qt reports sample rates and formats as expected. Somewhere in there is a filter that's being secretly applied. 20kHz bandwidth is suspiciously related to a 44.1kHz sample rate.

          1 Reply Last reply
          1
          • Kent-DorfmanK Offline
            Kent-DorfmanK Offline
            Kent-Dorfman
            wrote last edited by
            #5

            Is the "correct" audio format being set in your example? Many of the listed audio codecs will compress the data at the expense of fidelity, especially since you are interested in frequency ranges above normal auditory sense. WAV is the only format I have experience with for higher frequencies: sampling bat echolocation calls and creating species census based on the frequency signature.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SwimRideRunCode
              wrote last edited by SwimRideRunCode
              #6

              If you are referring to file format, it is wav and supports the full sample rate. You can see from the screenshot that the full bandwidth is ~96kHz. The cutoff is clear at 20kHz. Also, 192000 is reported as the sample rate in the file meta information in Audacity.

              I'm using the Example program to remove any suspicion that it's something in my code. I've been working on my project part time on and off for years and have always seen the full bandwidth. It's only with my new machine, OS and Qt version that I've seen the filtering. All of the drivers report the device as 192000 sample rate and the "pro audio" settings are used. Audacity apparently uses alsa and can see the full bandwidth.

              If I do:

              arecord -D hw:1,0 -c 2 -f S16_LE -r 192000 test.wav

              ...then the wav file shows the full signal, so it's not drivers.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SwimRideRunCode
                wrote last edited by
                #7

                ...well, I guess arecord is ALSA only(?)
                I will look for a program that explicitly uses PipeWire and/or Pulse to see if they behave. It could be a bug in those drivers where they ignore the "Pro Audio" setting (or misinterpret it).

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SwimRideRunCode
                  wrote last edited by
                  #8

                  Ah! It's PipeWire.

                  pw-cat --record --target alsa_input.usb-Hanlincrest_Ltd._FUNcube_Dongle_V2.0-00.pro-input-0 --rate 192000 --format s16 sdr.raw
                  sox -t raw -r 192000 -e signed -b 16 -c 2 sdr.raw sdr.wav
                  

                  ...results in a wav file with the same 20kHz filtering. Now I need to find out how to fix that. "Pro Audio" setting isn't working.

                  I guess this is solved from a Qt point of view.

                  1 Reply Last reply
                  1
                  • S SwimRideRunCode has marked this topic as solved

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved