Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Equipment & Tools From test equipment to hand tools

Support for high samplerates in SW analyzers
Support for high samplerates in SW analyzers
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 6th February 2020, 05:49 PM   #1
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Default Support for high samplerates in SW analyzers

After a few patches the RPI4 USB audio class 2 gadget supports the maximum 1024bytes packets size in USB2 microframe (i.e. 8000 x 1024 bytes = 65Mbits/s duplex throughput) now. Good opportunity to test how common software analyzers deal with high samplerates.

Tested in linux which accepts any samplerate reported by the USB audio device. I configured the gadget to use 1536kHz/24bit/1ch (36.9Mbits/s), with sox generating 700kHz sine signal on the RPi. The USB host was capturing from the USB gadget and analyzing .

Arta in wine - fixed samplerate at 192kHz, not working

REW - not tested yet but definitely will require low-latency garbage collector of the latest java.

Audacity - while it accepts files with any samplerate (I have tested 10MHz files), its soundcard backend is limited by portaudio samplerate range, probably could be changed and recompiled. Stock version not working.


VisualAnalyzer in wine - did not offer the device samplerate, but could be configured at any samplerate. Would require some work (from its author as it is not open source) but its potential is quite good. Screenshot taken.


jaaa - a simple open source FFT analyzer in linux, works OK. Unfortunately only 128k FFT length which is quite little. But this could be changed in the source code. Screenshot taken.
Attached Images
File Type: png va.png (107.0 KB, 93 views)
File Type: png jaaa.png (39.6 KB, 93 views)
  Reply With Quote
Old 6th February 2020, 06:10 PM   #2
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
2,304kHz/24bit/1ch (55Mbit/s), sine 1.1MHz, VisualAnalyzer, jaaa
Attached Images
File Type: png va2.png (102.5 KB, 98 views)
File Type: png jaa2.png (40.4 KB, 96 views)
  Reply With Quote
Old 6th February 2020, 06:48 PM   #3
Frex is offline Frex  France
diyAudio Member
 
Join Date: Nov 2009
Hello,

Are you saying that you can send 1.536MSPS thru an Rpi USB interface see as an audio device ?
If yes, it's wonderful, you have the last missing brick i would need for my OSVA project !
I suppose you send not real audio data but digital lockup table ?

Frex

Last edited by Frex; 6th February 2020 at 06:50 PM.
  Reply With Quote
Old 6th February 2020, 07:33 PM   #4
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by Frex View Post
Are you saying that you can send 1.536MSPS thru an Rpi USB interface see as an audio device ?
The max. current bandwidth is 1024 bytes per 8000 microframes per second, i.e. 65,536,000 bits per second. You can split it by samplerate, sample bitwidth and channel count as you wish. For 24bit/1ch that makes 2,730,666 samples per second.

Quote:
If yes, it's wonderful, you have the last missing brick i would need for my OSVA project !
The gadget is still adaptive, i.e. timed by the USB host. That is OK e.g. for a DSP loopback mode with no extra clock involved. But you have a master clock by your ADC, you need an async chain controlled by your clock. Still quite some work to achieve that. But that is my plan.

The more difficult question is how to get samples from your ADC to the RPi, to be sent to USB host in the USB audio format.

Quote:
I suppose you send not real audio data but digital lockup table ?
Sox generates a regular 24bit audio stream. Of course the stream is artificially generated on RPi, I have no 2.3MHz 24bit capturing device hooked to the RPi.

Last edited by phofman; 6th February 2020 at 07:37 PM.
  Reply With Quote
Old 6th February 2020, 09:52 PM   #5
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
jaaa is really trivial to modify, nice code.

Max FFT length increased to 8M, min. amplitude lowered to -220dB. The analyzer takes about 30% of one core. Fundamental determined exactly at 1100000.0Hz. Completely stable operation on both sides, no buffer xruns.

Code:
sox -V -r 2304000 -n  -b 24 -c 1 -t alsa hw:2 synth 100000 sine 1100k
sox:      SoX v14.4.2

Input File     : '' (null)
Channels       : 1
Sample Rate    : 2.304e+06
Precision      : 32-bit


Output File    : 'hw:2' (alsa)
Channels       : 1
Sample Rate    : 2.304e+06
Precision      : 24-bit
Sample Encoding: 24-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

sox INFO sox: effects chain: input      2.304e+06Hz  1 channels
sox INFO sox: effects chain: synth      2.304e+06Hz  1 channels
sox INFO sox: effects chain: output     2.304e+06Hz  1 channels

Code:
Capture:
  Status: Running
    Interface = 2
    Altset = 1
    Packet Size = 864
    Momentary freq = 2304000 Hz (0x120.0000)
  Interface 2
    Altset 1
    Format: S24_3LE
    Channels: 1
    Endpoint: 1 IN (ASYNC)
    Rates: 2304000
    Data packet interval: 125 us

Code:
access: MMAP_INTERLEAVED
format: S24_3LE
subformat: STD
channels: 1
rate: 2304000 (2304000/1)
period_size: 100000
buffer_size: 200000
Attached Images
File Type: png jaaa-8M.png (43.4 KB, 61 views)
  Reply With Quote
Old 6th February 2020, 10:06 PM   #6
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Finally the usable maximum available - 14 x 192kHz = 2.688MHz. Spectrum for sine at 1.3MHz 0dBFS. Packet size 1008 is getting close to maximum 1024.


Code:
Capture:
  Status: Running
    Interface = 2
    Altset = 1
    Packet Size = 1008
    Momentary freq = 2688000 Hz (0x150.0000)
  Interface 2
    Altset 1
    Format: S24_3LE
    Channels: 1
    Endpoint: 1 IN (ASYNC)
    Rates: 2688000
    Data packet interval: 125 us
Now just getting the DAC/ADC :-)
Attached Images
File Type: png jaaa-2.6MHz.png (43.7 KB, 25 views)
  Reply With Quote

Reply


Support for high samplerates in SW analyzersHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2013 List: Affordable High Fidelity MP3 Players w 6.3mm jack, FLAC APE support? Eftegarie Digital Source 0 20th March 2013 11:41 AM
Spectrum Analyzers howe0168 Equipment & Tools 8 19th March 2012 05:54 PM
Any high resolution diy spectrum analyzers ? percy Equipment & Tools 32 9th March 2012 08:25 PM
R2 Distortion Analyzers better than one? jackinnj Equipment & Tools 0 12th September 2006 01:49 AM


New To Site? Need Help?

All times are GMT. The time now is 02:28 PM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 15.00%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright ©1999-2020 diyAudio
Wiki