|
|
|||||||
| Home | Forums | Rules | Articles | 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 |
|
|
#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. |
|
|
|
|
#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. |
|
|
|
|
|
#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 - |
|
|
|
|
#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. |
|
|
|
|
#15 | |
|
diyAudio Member
Join Date: Nov 2002
Location: Netherlands
|
Quote:
Hi, FYI, have also a look here: http://www.fesb.hr/~mateljan/arta/ It works with 192 kHz soundcards as well. The build-in 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. |
|
|
|
|
|
#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). |
|
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Amplitude and frequency distributions wanted | DouglasSelf | Solid State | 12 | 20th January 2012 10:18 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? |
| Page generated in 0.09322 seconds (82.77% PHP - 17.23% MySQL) with 11 queries |