
Home  Forums  Rules  Articles  The diyAudio Store  Gallery  Blogs  Register  Donations  FAQ  Calendar  Search  Today's Posts  Mark Forums Read  Search 
Equipment & Tools From test equipment to hand tools 

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 

Thread Tools  Search this Thread 
22nd November 2007, 05:44 PM  #11 
diyAudio Member
Join Date: Apr 2004
Location: MN

still haven't tried LTspice or Scilab but ended up writing a script to generate my own sine wave! I even wrote my own function to calculate sine based on taylor series. Its interesting how much precision (atleast 7 digits after the decimal point for 16 bit depth) is required to avoid rounding errors and take the precision upto or less than 1LSB.
I have yet to add the file creation part to write to a pcm wav file. Once that is done I will know how much distortion there is in the produced wave, or lack thereoff. In v2.0, complex waves  ability to add harmonics with variable amplitude! I wonder if these packages, or the languages they are written in, have the kind of precision for these type of operations. 
23rd November 2007, 08:02 AM  #12  
diyAudio Member
Join Date: Jul 2004
Location: Scottish Borders

Quote:
If you do breakdown a squarewave into it's components one finds that the harmonics go out to infinity. That is the problem. The digital datastream runs out of bits in the range of 44Ks/S to 192ks/S. I have seen it estimated that a good approximation to a squarewave can be reconstructed if all the harmonics up to the tenth are included in the signal. To reconstruct a reasonable 96kHz squarewave would require a bit rate of 1Ms/S or looked at from CD datarates it should be possible to get a 4kHz squarewave from the DAC. I suspect that even a 4kHz sinewave coming out of a CD DAC will show significant distortion. Does anyone have any figures?
__________________
regards Andrew T. 

17th December 2007, 09:05 PM  #13 
diyAudio Member
Join Date: Apr 2004
Location: MN

6 digits of precision(i.e. after the decimal point) and processing the sine series(taylor polynomial) up to the 9th degree is what you need in the least to create a sine wave with distortion buried in the noise floor.
Note that I did not say "without distortion". It is there, just not discernable. I had been fooling around with creating a wav file of a pure tone and observing what kind of loss of precision generates what kind of distortion and thought I'd share some results with you. It is a common belief that computing upto the 7th degree of the Taylor series for a sine function is a good enough approximation for a sine function. Wrong. You need alteast one more degree i.e. upto 9th degree to achieve a sine wave which has very little distortion. Here's a screen shot of the FFT of a 500hz sine wave produced with the sine function computing only upto the 7th degree  
17th December 2007, 09:06 PM  #14 
diyAudio Member
Join Date: Apr 2004
Location: MN

and here's a screen shot of the FFT of a 500hz sine wave produced with the same sine function, but computing upto the 9th degree 
FFTs were done with the spectrum analyzer provided in RMAA 6 with a Kaiser window of atleast 15. 
19th December 2007, 06:25 PM  #15  
diyAudio Member
Join Date: Nov 2002
Location: Netherlands

Re: Tone Generator  Multiple Tones and Variable Amplitude
Quote:
Hi, FYI, have also a look here: http://www.fesb.hr/~mateljan/arta/ It works with 192 kHz soundcards as well. The buildin sine generator can do dual tones with adjustable ratio quite accurate. Attached a picture of a loop through measurement of my USB soundcard at 44.1 kHz. 

20th December 2007, 02:17 PM  #16 
diyAudio Member
Join Date: Apr 2004
Location: MN

I don't think it can save it to a wav file, does it ?
I want a "generated" wav file, not a "recorded" wav file (to avoid introducing deficiences of the playback + recording chain). 
Thread Tools  Search this Thread 


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Amplitude and frequency distributions wanted  DouglasSelf  Solid State  13  18th September 2013 07:54 PM 
Pressure sensor to control amplitude  Dogue  Instruments and Amps  7  15th October 2008 11:22 PM 
Why do sweep signals have progressively decreasing amplitude ?  percy  Equipment & Tools  6  13th February 2008 12:08 AM 
Audio Signal Amplitude Levels..?  xitronics  Analog Line Level  0  16th October 2006 04:19 PM 
New To Site?  Need Help? 