Audacity sine generation - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc.

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 14th November 2012, 04:59 AM   #1
diyAudio Member
 
panson_hk's Avatar
 
Join Date: Aug 2005
Blog Entries: 10
Default Audacity sine generation

This topic might not be new. But the data to be shown are probably "new". The tools involved are USBStreamer, WM8740 DAC board, Audacity and WinAudioMLS.

A 1 kHz wav (Fs = 48 kHz) file was generated by Audacity. The file was analyzed by WinAudioMLS. 16k-point FFT with Rife-Vincent 4 window function was used to analyze the file. FFT plot is shown below.
Attached Images
File Type: jpg Audacity wav file analysiss.jpg (125.6 KB, 87 views)
  Reply With Quote
Old 14th November 2012, 07:29 AM   #2
diyAudio Member
 
panson_hk's Avatar
 
Join Date: Aug 2005
Blog Entries: 10
In contrast to the above 16 bit, 48 kHz wav file, Audacity can also export 24 bit, 48 kHz wav file. FFT analysis of this wav file is shown below.

I also used AP2700 to generate a 1kHz wav file. In the utility, 24 bit and 48 kHz was selected. As can be seen, AP generated wav file is effectively a perfect 1 kHz sine.
Attached Images
File Type: jpg Audacity 24b 48k wav file analysiss.jpg (128.5 KB, 71 views)
File Type: jpg AP 1k wav file analysis.jpg (128.5 KB, 68 views)
  Reply With Quote
Old 14th November 2012, 07:47 AM   #3
diyAudio Member
 
panson_hk's Avatar
 
Join Date: Aug 2005
Blog Entries: 10
Hardware is now involved. Signal is loopback at I2S interface of USBStreamer. No ADC/DAC is involved.

WinAudioMLS ASIO signal generator plays wav file and also generates sine. It can be seen that AP generated wav file is still the best.
Attached Images
File Type: jpg WinAudioMLS ASIO SigGen Play wav files.jpg (378.9 KB, 67 views)
File Type: jpg Loopback WinAudioMLS-Audacity-AP compare.jpg (131.9 KB, 65 views)
  Reply With Quote
Old 15th November 2012, 08:52 AM   #4
diyAudio Member
 
freax's Avatar
 
Join Date: Sep 2007
you know what you could do to improve things? add a notch filter and let only the 1kHz sine through and discard everything else....

Ah nevermind, I am a giddy goat, those noise levels are the noise floor....
__________________
"It seems that perfection is reached not when there is nothing left to add, but when there is nothing left to take away" - Antoine de Saint Exupéry

Last edited by freax; 15th November 2012 at 08:56 AM.
  Reply With Quote
Old 15th November 2012, 09:25 AM   #5
diyAudio Member
 
freax's Avatar
 
Join Date: Sep 2007
Have you considered using the click track generator in audacity for audio analysis and testing of rise/fall times?
__________________
"It seems that perfection is reached not when there is nothing left to add, but when there is nothing left to take away" - Antoine de Saint Exupéry
  Reply With Quote
Old 15th November 2012, 09:42 AM   #6
jcx is offline jcx  United States
diyAudio Member
 
Join Date: Feb 2003
Location: ..
you're just looking at digital sines - the "hardware" to move the bits will always be "perfect" - or the digital interface is simply broken - no need to look at -170 dB distortion to see that

you should be able to select dither for the Audacity sine too - although they use a frequency shaped differentiated dther
  Reply With Quote
Old 15th November 2012, 11:24 AM   #7
KSTR is offline KSTR  Germany
diyAudio Member
 
KSTR's Avatar
 
Join Date: Jul 2007
Location: Central Berlin, Germany
Hi,

I've played a lot with software sine generation in the past and indeed not all programms allow you to go theoretical and practical limits of purity. I've never used Audacity, though.

All I can say for x86(PC)-based systems that the math operation of the FPU (floating point unit of the CPU) is NOT the culprit. I was able to get perfect 24bit precision using the old Turbo-C compiler, from way back in the early 90'ies.

I also anaysed 64-bit double precision floating-point output from the FPU with FFT working in the same domain and found the results to be free of any worries. Without dithering this allow one to better see some aspects of sine generation.

It's best to use exact FFT bin center frequencies only so you don't need any windowing and you may use synced averaging.

You may need to trick the software by setting the sample rate to the FFT size (65536Hz for a 65536-pt. FFT) so that bin frequencies are integer and spaced "1Hz" apart (but scaled). Then overwrite the samplerate field in the ouput with desired value, the ratio determining the scale factor to be used.

You want to avoid the repetition of identical value sequences within one FFT block, therefore the "unit frequency" (bin number) should not contain any factors of two (assuming a 2^N FFT block size). TThat's the reason for the 997Hz used with 48kHz. 1kHz would loop one very short 48 samples block all the time.

This sort of maximally self-dithers the values but additional dithering should be used when going to integer 24 or 16 bit output. Here the period of the random generator used for the dithering should also be non-related to FFT size and notably much larger.
  Reply With Quote

Reply


Hide 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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Krill - The Next Generation Steve Dunlap Solid State 440 20th August 2010 10:29 PM
generation x old school badcompany Pass Labs 0 25th July 2008 04:32 PM
Sine Wave Generator with bulbs (Sine-lightenment) Rodeodave Everything Else 6 21st July 2008 01:19 PM
Audacity sine - Is this good enough? keantoken Equipment & Tools 11 21st November 2006 01:30 AM
pwm generation sundeep2802 Class D 1 18th March 2005 06:39 PM


New To Site? Need Help?

All times are GMT. The time now is 10:55 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright ©1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2