"Ideal Sine" for measuring audio devices. - Page 1
Forum section: electronics / beginners

author: Korchahin
author_rank: Regular Contributor
timestamp: October 20, 2024, 04:26:50 pm
content: Hello comrades! We need an “ideal sine” generator circuit to work with audio devices. There is an E1DA Cosmos ADC. Probably the best ADC for these purposes. There are also some DACs. On dual mono PCM1794 and another on AK4499. They both have low harmonics. However, the presence of harmonics makes it difficult to understand the harmonic distortion of an amplifier because it exactly repeats and does not exceed the harmonics of the DAC. Today the 2nd harmonic on amplifier is less than >120 dB.In view of this, I decided to make a circuit for an ideal sine wave generator with the lowest possible harmonic distortion. There is an assumption to use a multivibrator based on JFET transistors or presisions OP-AMPs, with a bandpass filter and a “reference voltage source”.Requirements:1. Lowest level of harmonic distortion.2. Lowest noise level (1Hz-100KHz)3.Output 2.83V RMS4. Frequency 1KHz. It seems to me that it is possible to adjust the frequency, which will introduce difficulties in adjusting the bandpass filter and the master circuits of the generator.5. Highest grade precision components are welcomed.Please suggest a diagram, solutions or materials on this topic.Thank you!

author: TERRA Operative
author_rank: Super Contributor
timestamp: October 20, 2024, 05:27:51 pm
content: Take a look at the Tektronix SG505, it is an ultra low distortion frequency generator that might provide some ideas.https://w140.com/tekwiki/wiki/SG505

author: tggzzz
author_rank: Super Contributor
timestamp: October 20, 2024, 05:33:35 pm
content: Quote from: Korchahin on October 20, 2024, 04:26:50 pmOne approach:https://wwhttps://www.edn.com/getting-an-audio-signal-with-a-thd-0-0002-made-easy/w.edn.com/getting-an-audio-signal-with-a-thd-0-0002-made-easy/

author: RoGeorge
author_rank: Super Contributor
timestamp: October 20, 2024, 05:39:08 pm
content: See chapter "7. Max Wien, Mr. Hewlett, and a Rainy Sunday Afternoon"http://www.introni.it/pdf/Williams%2007%20-%20Book%20Chapters.pdf

author: voltsandjolts
author_rank: Unknown
timestamp: October 20, 2024, 05:45:45 pm
content: Quote from: tggzzz on October 20, 2024, 05:33:35 pmFixing link:https://www.edn.com/getting-an-audio-signal-with-a-thd-0-0002-made-easy/

author: jonpaul
author_rank: Super Contributor
timestamp: October 20, 2024, 05:50:20 pm
content: "An Ultra Pure Oscillator," AN-67, 1996. Jim Williams Linear Technology (old friend, RIP)https://www.diyaudio.com/community/attachments/an-ultrapure-oscillator-from-an67f-pdf.165897/Audio Precisionhttps://www.ap.com/analyzers-accessoriesPrisim Mediahttp://prismsound.com/test_measure/products_subs/dscope/dscope_home.phpHewlett and Packard at Stanford 1938https://www.hpmemoryproject.org/wa_pages/wall_a_page_00.htmhttps://www.hpmemoryproject.org/wa_pages/wall_a_page_01.htmHave an absolutely fantastic day !Jon

author: CaptDon
author_rank: Super Contributor
timestamp: October 20, 2024, 09:51:13 pm
content: Look for a Potomac Instruments AG unit used by many radio stations for proof of performance measurements. There is a companion AA unit Audio Analyzer. A long time back HP made similar gear.

author: Smokey
author_rank: Super Contributor
timestamp: October 20, 2024, 10:48:45 pm
content: I always think it's funny when "audio" guys talk abstractly about precision and distortion. If the signal is ultimately being consumed by a meat computer through the holes in the sides of your head, there is an upper limit to how good a signal really needs to be (even if you have a $10,000 piece of test equipment, and know how to use it, that can actually quantify many zeros of distortion somewhere in the signal chain).Get a Keithley 2015 and use that as a source, as well as distortion meter.

author: coppice
author_rank: Super Contributor
timestamp: October 20, 2024, 10:59:56 pm
content: Quote from: Smokey on October 20, 2024, 10:48:45 pmThat's true if you are talking about audio delivery. However, if the audio is way beyond the best you can hear, you get an awful lot of additional flexibility when recording, scaling, mixing, munging and otherwise manipulating the audio in ways that may reduce its quality.

author: Smokey
author_rank: Super Contributor
timestamp: October 20, 2024, 11:10:23 pm
content: Quote from: coppice on October 20, 2024, 10:59:56 pmTotally. You want the best possible pure signal fidelity you can have while mixing ... in order to feed into that killer reverb plugin with the heavy envelope filter and a bit of compression...

author: tggzzz
author_rank: Super Contributor
timestamp: October 20, 2024, 11:23:13 pm
content: Quote from: Smokey on October 20, 2024, 11:10:23 pmYou are recording an orchestra.Where do you put the microphone for "best possible pure signal fidelity"?You can't have an objective absolute; everything is subjective.

author: Sensorcat
author_rank: Regular Contributor
timestamp: October 20, 2024, 11:27:30 pm
content: Quote from: voltsandjolts on October 20, 2024, 05:45:45 pmThat's an interesting approach. With a modern two-channel FG, it's even easier to implement: You can skip the µC and OSC, create the f_FG sine and the 100*f_FG square directly and feed it to the MAX293. If channel tracking is available, the frequency ratio could be preserved by only adjusting one channel.

author: coppice
author_rank: Super Contributor
timestamp: October 20, 2024, 11:32:02 pm
content: Quote from: tggzzz on October 20, 2024, 11:23:13 pmActually, orchestras are relatively easy to record. Their output is fairly predictable. They operate in the same bunch of places over and over. Recording people get used to what works, set things up in a proven manner, and they are good to go. Higher quality is needed when you record ad hoc people in ad hoc places. You can't predict how to set levels very well. A super low floor of noise and crud lets you crank down the gain, avoid any chance of clipping, and be able to turn the gain up to restore the volume during downstream processing, without unpleasant results. The summing of noise from many mics and pickups in complex layered recordings, and other complexities of recording many separate pieces and combining them, is also demanding on signal quality.

author: langwadt
author_rank: Super Contributor
timestamp: October 20, 2024, 11:34:25 pm
content: Quote from: Smokey on October 20, 2024, 11:10:23 pmand then distribute it as an MP3 to be played on a phones build in speaker

author: David Hess
author_rank: Super Contributor
timestamp: October 21, 2024, 01:50:42 am
content: Start here and pay particular attention to the references at the end:http://www.janascard.cz/PDF/An%20ultra%20low%20distortion%20oscillator%20with%20THD%20below%20-140%20dB.pdfAnd then check out page 62 of Linear Technology application note 67 - Using Super Op Amps to Push Technological Frontiers: An Ultrapure Oscillator by Dale Eagar.https://www.analog.com/media/en/technical-documentation/application-notes/an67f.pdfThis design has apparently has distortion so low that it has defied attempts to quantify it.

author: radar_macgyver
author_rank: Frequent Contributor
timestamp: October 21, 2024, 02:31:22 am
content: The generator in theQA403is pretty good, -105 dB THD+N.

author: CaptDon
author_rank: Super Contributor
timestamp: October 21, 2024, 02:37:58 am
content: Please explain your "better than 120Db" example. If you have a signal generator which is that clean where do you want to go? Is that harmonic measured down from where, what is your reference signal, 0Vu, 0Dbv, 0Dbm, 1VRMS? What is the purity of your DAC generator or is that the 120Db down unit? Again, if the generator has THD 120Db down from 0DBV and the amplifier seems to add no additional distortion I don't see you making much better specs from that point. Where on the amplifiers curve are you measuring that spec? Full output before clipping? Nominal 0Vu? Max output before THD increases? I usually want at least 10Db of headroom above what we want to call 'average' level or 0Vu on a metering device with proper ballastics. I could measure down from that headroom level, or measure down from the 0Vu level, or measure down from the maximum digital number allowed in the recording chain. If you are talking about 120Db down then I am guessing we are in the 24 bit 96KHz world because you can't get 120Db dynamic range at 16 bits. Isn't the 16 bit limit around 96Db due to dither and such? I'd be happy at 120Db down any day. The pleasing sounds of musical instruments comes from the even harmonics and when it comes to vinyl I don't think we ever measured better than 3 to 5% THD on a 1KHz tone when played back from the NAB test recordings. It was even harmonics by the way which is probably why the audiophools say vinyl is the most pleasing medium?

author: BillyO
author_rank: Super Contributor
timestamp: October 21, 2024, 03:17:05 am
content: I think we're in the "Audio Fool" realm here. You are already -120db down on the 2nd harmonic and you are looking for better than that? You made need an Audio Grade network switch to get that using gold plated #8 CAT12 cabling. I can sell you the Audio Grade network switch for $13,000, but the CAT12 cable will cost $3,370 per meter.Just joking! Honestly!

author: Messtechniker
author_rank: Frequent Contributor
timestamp: October 21, 2024, 05:28:14 am
content: Why on earth does everyone ignoreloudspeaker distortion levels of 1 to 5 %(-40 dB at best) or so. Plus the nonlinear distortionproduced by our own ears.Thus it does not make much sense aiming atreducing distortion levels in the -120 dB region.

author: tggzzz
author_rank: Super Contributor
timestamp: October 21, 2024, 09:40:00 am
content: Quote from: coppice on October 20, 2024, 11:32:02 pmI have no reason to doubt thatBut the mere act of using multiple microphones and then mixing them means there is no "pure signal fidelity". It is a personal choice of what sounds "good". That's just fine, of course."Pure signal fidelity" is one of those terms I associate with people that have more money than sense, and is another example of why there are those three words under my monker

author: tggzzz
author_rank: Super Contributor
timestamp: October 21, 2024, 09:46:09 am
content: Quote from: Messtechniker on October 21, 2024, 05:28:14 amThat is grossly understating the non-linearity of the ear-brain combination.The ear-brain combination is non-linear in every way you can think of, and then someThe non-linearity is the reason audio compression can be effective.

author: squadchannel
author_rank: Frequent Contributor
timestamp: October 21, 2024, 09:53:12 am
content: for low distortion, hp 8903B Audio analyzer.It is probably the most well-known measuring instrument.But it's not cheap.No matter how good the sound is, the human ear is not equipped with a very good ADC.In terms of quantification, the better the performance, the better.

author: Andree Henkel
author_rank: Regular Contributor
timestamp: October 21, 2024, 11:24:12 am
content: As you are german,here is an east german Sine Generator for Audio frequencies based on Wien-Bridge.I used it myself (not thi unit) during my Lehrausbildung.It does do its job. Maybe not the lowest THD, but at least low THD because of Wien-Bridge with magnitude regulation by nonlinear behaviour of a light filament.https://www.ebay.de/itm/196695113544?chn=ps&_ul=DE&norover=1&mkscid=101&itemid=196695113544&targetid=2352311494706&device=c&mktype=pla&googleloc=9042960&poi=&campaignid=21766256383&mkgroupid=166044918177&rlsatarget=pla-2352311494706&abcId=10044331&merchantid=7364532&gad_source=1

author: David Hess
author_rank: Super Contributor
timestamp: October 21, 2024, 11:53:00 am
content: For a more practical design of a low distortion oscillator, take a look at Bob Cordell's THD analyzer which apparently includes a modernized version of the Tektronix SG505 ultra-low distortion oscillator as a signal source. This would be more than good enough for anything except testing the best audio ADCs, and maybe it would be good enough for them also:https://www.cordellaudio.com/instrumentation/thd_analyzer.shtmlQuote from: BillyO on October 21, 2024, 03:17:05 amThe lowest distortion oscillators like I have described are useful when testing high resolution ADCs. Otherwise there is no way to test and verify their performance. The best audio amplifiers also require pretty good signal sources for testing. For everything else, a DAC based signal source is more than enough, but various analog and digital function generators are likely not good enough.Speakers are horrible as far as distortion. They can be tested with a function generator.

author: MrAl
author_rank: Super Contributor
timestamp: October 21, 2024, 12:49:50 pm
content: Quote from: Messtechniker on October 21, 2024, 05:28:14 amHello there,I think it is sometimes more about specifying rather than producing. If you build something and want to test it so you can tell your buyers how 'good' it is, then you want to use good test equipment. This way you can be sure when you state that it has 0.1 percent THD or whatever it is. If your test equipment adds to the distortion, it's harder to figure out what the THD of the actual device under test is.Also, audiophiles often use high priced headphones not speakers. They would be much better than speakers but it's hard to say how much better because I don't use them I use average priced headphones.

author: MrAl
author_rank: Super Contributor
timestamp: October 21, 2024, 12:53:37 pm
content: Quote from: Korchahin on October 20, 2024, 04:26:50 pmHi,A square wave and bandpass filter can work pretty well. If you do go that route, I would suggest using an air core inductor and high quality capacitor, the kind of capacitor that is not too sensitive to external disturbances. You also may want to filter more than with just one stage, that's the way some really good frequency generators do it when they use DSP techniques.If your frequency is fixed you got it made. If it's not, it's going to require changing the filter(s) component(s) for each frequency.

author: SteveThackery
author_rank: Super Contributor
timestamp: October 21, 2024, 02:44:17 pm
content: So presumably a stepped sine wave with filter would be even better? I visualise the harmonic content being less than that from a square wave. Is that right?

author: Andy Chee
author_rank: Super Contributor
timestamp: October 21, 2024, 02:53:59 pm
content: Perhaps this will give some ideas?https://sound-au.com/articles/sinewave.htm

author: Korchahin
author_rank: Regular Contributor
timestamp: October 21, 2024, 03:32:54 pm
content: Thanks everyone! Lots of interesting information to digest and learn from. I will try to implement generators with a Winn bridge and conduct research.The first thing I want to draw your attention to is that this need is strictly related to technical perfectionism and achieving the maximum. Just like here, many achieve 0.1ppm V and 8.5 digits to measure their dignity.Second) No ears or other esoteric measurement methods are applicable. Only objective and physically verifiable figures.In my topic, we are not talking about perception or other actions on sound.Only technical perfectionism.This is my hobby and I am looking for ways to achieve it at a reasonable cost. I'm a music lover, but not an audiophile who would say goodbye to his pants for a silver cable with iridium connectors.Common sense is paramount.P.S. This is what the frequency response of the DAC looks like.These sticks at 2kHz and 3kHz continue to hinder me like weeds from enjoying the perfect 1kHz spike

author: radiolistener
author_rank: Super Contributor
timestamp: October 21, 2024, 04:43:18 pm
content: Quote from: Korchahin on October 21, 2024, 03:32:54 pmCan you show the same for 5669 Hz sine carrier?

author: David Hess
author_rank: Super Contributor
timestamp: October 21, 2024, 05:42:44 pm
content: Quote from: Korchahin on October 21, 2024, 03:32:54 pmA Wien bridge would be my first choice. It is also possible to implement a variable frequency Wien bridge with one potentiometer rather than ganged potentiometers, as shown in AB-112 included below.I would combine that with the amplitude stabilization and common mode suppression discussed starting on page 29 of Linear Technology application note 43 where Jim Williams goes over how to improve the Wien Bridge oscillator. Note that there is a mistake in the application note where two of the later schematics in the figures are swapped. I would keep the JFET based amplitude control with the LT1022 common mode suppression rather than implementing the photocell circuit but this means combining two different schematics. The photocell part has not been available for a long time now.

author: TimFox
author_rank: Super Contributor
timestamp: October 21, 2024, 05:47:17 pm
content: For my humble purposes (measurable audio distortion, rather than audible), the 20 ppm residual THD (-94 dBc) I obtain with my -hp- 339A analyzer, usable over the audio frequency range, is adequate and convenient.If you want to implement a single frequency sine wave by filtering a square wave, be sure to tweak the symmetry (mark vs. space).An ideal square wave contains no even harmonics, but time asymmetry will introduce a second harmonic (and others), but the second harmonic is the hardest to filter out.(Of course, the third harmonic is the dominant harmonic product.)If you have a spectrum analyzer that goes down to 1 kHz, you can see easily the appearance of the second harmonic as you adjust the symmetry.A good CMOS flip-flop is probably the easiest way to get a symmetric square wave.

author: langwadt
author_rank: Super Contributor
timestamp: October 21, 2024, 07:57:07 pm
content: Quote from: TimFox on October 21, 2024, 05:47:17 pmyou can in principle make the 3rd go away with a stepped waveform (+1,+1,0,-1,-1,0) aka. what inverters call "modified sine ware"or there's these,https://www.tinaja.com/magsn01.shtml

author: ssashton
author_rank: Frequent Contributor
timestamp: October 21, 2024, 08:32:48 pm
content: Here you are:https://viccc42.wixsite.com/uld-audio

author: CaptDon
author_rank: Super Contributor
timestamp: October 21, 2024, 10:10:45 pm
content: I see the reason for the mixing / gathering areas to be as clean as possible so that if additional gain is required during mixdown things stay quiet and undistorted. I think in the practical world of audio frequencies there is a noise floor of around -135Db simply due to component shot noise and kelvin noise of even a single buffer / amplifier stage at room temperature. When they state apprx -135Db I am not sure what the 0Db reference level actually is? 1mw @ 600 ohms perhaps? We do need to know the reference to have useful meaning. It's been a while since I have been digging through my audio engineering and sound production handbooks. The system I use was built years ago. It has seen a lot of bands and venues and I generally get good compliments from the band and those in the venue who appreciate good live audio mixes. All of my speaker cabinets are home built and designed because I really never heard any 'affordable' store bought stuff for live bands that sounded good to me. Community and Clare Showco have some good stuff that gets sold off from time to time but it would set you back $50K or so for a 'system'. It all has to fit together with no artificial color or holes. I would refer to it as a system and not simply 'a whole bunch of stuff plugged into each other that we bought on Ebay.'

author: Korchahin
author_rank: Regular Contributor
timestamp: October 21, 2024, 10:17:33 pm
content: Quote from: ssashton on October 21, 2024, 08:32:48 pmThanks for the information.I found the details on another forum.https://www.diyaudio.com/community/threads/low-distortion-audio-range-oscillator.205304/page-307Product from "vicnic" (@Victor from Riga)

author: smaultre
author_rank: Regular Contributor
timestamp: October 22, 2024, 01:41:28 am
content: And yes, i can sell you a ultra-low distortion laboratory-grade extremely clean AIR! To fill-up your audiophile room!It's will cost such more, than Audio Grade network switch, and the CAT12 cable.. But it's worth...

author: RJSV
author_rank: Super Contributor
timestamp: October 22, 2024, 03:20:26 am
content: I attended the Keltic Festival this year, in Grass Valley, California. The discussion here on the live band audio systems reminds me, of some , er, 'quality' shortcomings:Firstly, the bands played inside a totally concrete gymnasium. Sensation was of a total sustained 'Howl', punctuated by drums.Lots and lots of medium delay reverb holding that 'howl'.I bet the band might have been able to adjust things to at least something better. That being adjusting the treble end.'MUDDY'....That's the word I'm searching for. Probably had the typical 15 inch woofer, in a PA cabinet, with a big hf horn on top.Muddy with 3X the proper reverb.

author: BILLPOD
author_rank: Frequent Contributor
timestamp: October 22, 2024, 12:40:05 pm
content: Good Morning Korchahin, go here:https://www.szynalski.com/tone-generator/,then just scope the earphone jack on your 'puter.

author: CaptDon
author_rank: Super Contributor
timestamp: October 22, 2024, 01:02:28 pm
content: We had a German um-pah band from Cleveland Ohio play at our local American Legion. Musician wise they were incredible, even played an alphorn along with one of their songs!! Fantastic! Their sound system sucked donkey nuts in a BIG way!!! Vocals so muddy you couldn't understand a single work even if you knew the song. I told them three times "You need to fix the vocals and the E.Q.". So at one point they did the typical "Check one two three" mic check and said it sounded o.k. to them. First off, the dumb ass was doing the check while on stage and so had not a clue what the front of house sounded like! Second, his mic check was at roughly 85Db SPL in the front of house (and muddy as hell) but when the band was playing they were at about 105 to 110Db in front of house so the muddy vocals were now buried by 15 to 20Db!!! Very sad that good bands just don't get the message and are reluctant to take any advice from someone studied and working in sound engineering. I still have a guy with the Bozo 802 tops that he won't stop using. Eight drivers, each one ohm in series!! He blows them up just about monthly. I have probably done over $500.00 so far in replacement drivers for him but he swears these are the best front of house tops ever made!!! They sound dull as shit compared to my tops and so the Bose Controller puts nearly 17Db of boost on the high end just to make the 802's sound 'acceptable'.

author: RoGeorge
author_rank: Super Contributor
timestamp: October 22, 2024, 05:33:06 pm
content: The symbol for decibel isdB, whileDbdoesn't mean anything.https://en.wikipedia.org/wiki/Decibel

author: Messtechniker
author_rank: Frequent Contributor
timestamp: October 22, 2024, 05:41:45 pm
content: Quote from: CaptDon on October 22, 2024, 01:02:28 pmIt's hopeless trying educate someone sound wise. I gave up 40 years ago.

author: langwadt
author_rank: Super Contributor
timestamp: October 22, 2024, 07:05:08 pm
content: Quote from: CaptDon on October 22, 2024, 01:02:28 pmhere all the venues have agreed on max 103dB, 15min average

author: The Soulman
author_rank: Super Contributor
timestamp: October 22, 2024, 07:09:46 pm
content: Quote from: langwadt on October 22, 2024, 07:05:08 pmA weighted?

author: langwadt
author_rank: Super Contributor
timestamp: October 22, 2024, 08:13:09 pm
content: Quote from: The Soulman on October 22, 2024, 07:09:46 pmyes

author: CaptDon
author_rank: Super Contributor
timestamp: October 23, 2024, 12:11:16 am
content: Previous poster is correct, Bel is a unit of measure named after a person so dB is correct for decibel. An old habit of me capitalizing the first letter like in Hz or MHz. It's a bad habit when I type Db, and I do it all the time. I'll watch it in the future. The meaning comes across, even mis-typed.

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2024, 12:14:59 am
content: "dB" without suffix is only used for ratios (such as gain or attenuation).There are many suffices that specify the denominator of the ratio: e.g., dBV (1.0 V), dBm (1 mW), dBc (with respect to carrier power).

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 02:34:11 am
content: Quote from: David Hess on October 21, 2024, 11:53:00 amSure, for those used in high-end test equipment, but for audio? Where does this make sense? Ears can't hear harmonics at -120db and even if they could, no headphones or speakers can reproduce sound that clean.

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2024, 02:42:21 am
content: Quote from: BillyO on October 23, 2024, 02:34:11 amIn H W Bode's classicNetwork analysis and feedback amplifier design, Van Nostrand, 1945, he answered this question for amplifiers used in telephone trunk lines.If you are designing a high-performance amplifier, you need equipment that is much better than the actual amplifier performance to judge it objectively (without so many golden ears).Also, if you optimize the design to an absurdly low distortion level, you may be confident that as things evolve in time, the performance will remain good, even if the distortion should increase a bit.And, if you are an enthusiast for electronics, your pride encourages you to strive for higher performance.(None of this is relevant to the young person driving the pickup truck next to me at the traffic light, where all I can hear is the bass line that has no intellectual content whatsoever.)

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 02:43:46 am
content: Quote from: TimFox on October 23, 2024, 12:14:59 amThat is the case here. When we say a harmonic is at -120db, that is the ratio between it and the principle frequency.

author: Analog Kid
author_rank: Super Contributor
timestamp: October 23, 2024, 02:50:41 am
content: Quote from: TimFox on October 23, 2024, 02:42:21 amHeh; more likely all you can hear is the buzzing and vibration of loose brackets, rivets, whatever, in their car body.Sounds like shit.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 02:55:27 am
content: Quote from: TimFox on October 23, 2024, 02:42:21 amNo doubt Tim. No argument here. In this case though, read the OP. He is talking about going better than-120db. That is < 10^-10%!!!!! Or to spell it out more graphically better than 0.00000000001%. Back in 1945Van NostrandH W Bode would have been tickled pink to get test equipment that could detect 0.1% distortion. The human ear has only been able to hear -80db at best. So test equipment at -90db would be clear overkill, let alone better than -120db.As to your young road mate, I doubt you would discern any worthwhile intellectual content from a full spectrum rendition of the noise they are listening to. Music today has been subject to considerable entropy.

author: Andy Chee
author_rank: Super Contributor
timestamp: October 23, 2024, 03:36:08 am
content: Quote from: BillyO on October 23, 2024, 02:55:27 amTrivia note. Human hearing limit is why 16-bit 44kHz was selected for the compact disc format. 16-bit is -96dB, more than enough for humans. 44kHz is the nyquist sampling rate for 22kHz, more than enough for humans.Nevertheless, higher bit depths and higher sampling rates are still useful in the DSP or mathematical transformation stages, which includes test equipment. How much higher? Well that's the debate isn't it....

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 03:57:04 am
content: Quote from: Andy Chee on October 23, 2024, 03:36:08 am1/65536 would be -68db. I wish it was -96, but math is math. Seems to me -96db would be around 32-bit (1/3,984,xxx,xxx).You may be talking about SNR.Distortion is measured in voltage, not in power like noise and dynamic range.I should use a real calculator, not that thing in Windows ..

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2024, 04:12:46 am
content: Quote from: BillyO on October 23, 2024, 03:57:04 amI'm sorry, but something with your math went wrong.See here on this online audio voltage to dB calculator.Image A: 65536/65536 = 1v = 0dBVImage B: 1/65536 = 0.00001525878906v = -96.32959861389708dBVLike you said, the math doesn't lie, so, I guess you did something wrong to arrive at your -68dB.Ok, measuring noise or dynamic range in power will change the math, right?Let's see:Say 1v of noise creates = 1w of noise via feeding a 1 ohm load.Now, feed a 1/65536 -> 0.00001525878906v into that 1 ohm load, you get 0.00001525878906 amps.0.00001525878906 amps * 0.00001525878906 volts = 0.0000000002328306437 watts of noise.Now, feed that noise power of 0.0000000002328306437 watts into a power -> dB calculator and:Wait, what?, -96dB once again....This seems funny, but math is math....

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 04:24:02 am
content: Quote from: BrianHG on October 23, 2024, 04:12:46 amI acquiesce, you are correct. My error.Wrong number of zeros. Sorry about that.

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2024, 04:39:16 am
content: Quote from: BillyO on October 23, 2024, 04:24:02 amI just updated my post to include Power to dB calculator and it still comes out to -96db.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 04:43:17 am
content: Quote from: BrianHG on October 23, 2024, 04:39:16 amYes, I admitted my error. What else do you need?

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2024, 04:48:03 am
content: Quote from: BillyO on October 23, 2024, 04:43:17 amSorry, didn't mean to offend. I did the additional power calculation update while you submitted you previous post. I do a lot of documentation myself and such errors are par for the course. Don't think anything of it....The exercise I did was just for those interested in how the math involved with audio voltage level and power level dB can line up.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 04:50:04 am
content: Quote from: BrianHG on October 23, 2024, 04:48:03 amNo worries. Your consideration is appreciated.

author: jonpaul
author_rank: Super Contributor
timestamp: October 23, 2024, 04:55:28 am
content: Audio distortion and dynamic range, jitter and digital audio dyn range are Very old topics1995 , AES paper Dynamic-Range Issues in the Modern Digital Audio Environment by Louis Fielder , Dolby Laboratorieshttps://secure.aes.org/forum/pubs/journal/?elib=7948AES paper preprint 2844 1989: Dr Steve Harris , Cirrus/Crystal Semi.Also see Dr Julian Dunn, Dr Malcom Hawksford etc.Enjoy,Jon

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2024, 05:03:41 am
content: Quote from: BillyO on October 23, 2024, 03:57:04 amI attached a .zip of a scientific tabulating calculator for you...It remembers all you entries and double clicking on the tabulation results enters the result into the equation line for copy and paste.It also follows order of operations and has most functions and constants.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 05:11:55 am
content: Quote from: BrianHG on October 23, 2024, 05:03:41 amThanks. However, my browser (google chrome) refuses to download it despite my pleading. It tells me that a virus is detected???

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2024, 05:31:34 am
content: Quote from: BillyO on October 23, 2024, 05:11:55 amI just tried downloading it in Firefox. No virus detected. I un-zipped it and ran it. Still no virus detected even with my ms security essentials scanning it.I've been using it since 1998, so if it were a virus, it would be a 16bit one from 26 years ago.I zipped it using Winrar 4.0, from 1993.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 05:33:57 am
content: Quote from: BrianHG on October 23, 2024, 05:31:34 amI'll try Firefox tomorrow. Thanks for help.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 05:46:39 am
content: Just tried it .. no sleep for the tired.This is what I got "Microsoft Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk."I run windows 11 on this system and on other systems the latest version of Windows 10. None of them will download the application.Can you provide a link to the website of the developer? Perhaps they have an updated version. I no longer have XP or Win 7 on line.

author: tggzzz
author_rank: Super Contributor
timestamp: October 23, 2024, 09:54:23 am
content: Quote from: BillyO on October 23, 2024, 02:43:46 amThat would traditionally be written -120dBc, where the "c" indicates "carrier".

author: CaptDon
author_rank: Super Contributor
timestamp: October 23, 2024, 12:22:59 pm
content: I gave some thought to the screen shot of the O.P.'s Spectrum Analyzer capture and I am curious about some things. My first thought, if it is a swept I.F. style of analyzer didn't we learn that the mixer section of the S.A. has its own limits as to creating unwanted harmonics and trash in the very non-linearities of the mixing stage and I.F. amplifiers? They must have provided their very own -dBc specs for the operation limits of the analyzer. Along that same line of thought, if the analyzer used A to D conversion followed by F.F.T. mathematical gymnastics wouldn't there also be artifacts internally generated even if the sinewave was absolutely pure? After all, there are probably also at least 4 types of F.F.T. calculation methods in the digital realm? Then, on top of all that doubt, what is all of that grass growing higher up in frequency on his plot? He never showed any concern on that aspect. I always thought the dBc spec was very meaningful. Take the very powerful audio amplifiers in the 1KW RMS level. Some manufacturers rate noise and such at -100dB below 1 watt output, others rate the bad actors at -100dB below maximum rated output (below the clipping point of course) which gives us a 30dB fudge factor between measurement styles!! Makes me think of the 'bad old days' where the stage lights and dimmers were using 5 times more power than the night club sound system and the 'dimmer hash' was only about 60dB below the average sound of the band! LED lighting was a blessing in more ways than one!!

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2024, 01:35:39 pm
content: Quote from: tggzzz on October 23, 2024, 09:54:23 amThat's what I wrote immediately after the snippet quoted by BillyO.

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2024, 01:37:32 pm
content: Quote from: CaptDon on October 23, 2024, 12:22:59 pmWhen dealing with SINAD or THD measurements, it is normal to use a filter to reject the fundamental frequency (such as a Wien bridge), and then measure what's left (harmonics and noise) on a swept-frequency SA to avoid the dynamic range problem.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 02:10:25 pm
content: Quote from: tggzzz on October 23, 2024, 09:54:23 amSuffixes are not a part of the SI units. dB is an SI unit, dBc is not. I guess it's a matter of how you were educated, but one should really not go around trying to "correct" someone just because they are not following whatever "convention" you prefer.Tell you what, don't call me out for using dB and I won't call you out for using dBc, or whatever other suffix you want to use (which are essentially meaningless if the subject of discussion is clear).

author: tggzzz
author_rank: Super Contributor
timestamp: October 23, 2024, 02:25:44 pm
content: Quote from: BillyO on October 23, 2024, 02:10:25 pmAs I wrote, it istraditionalusage. I did not claim it was a "correct" SI unit.Your statement precludes dBm, dbV etc. Those suffixes, and others, are used tomakethe subject of discussion "clear".If you dislike that usage, have fun disfiguring the front panels of all the equipment that use suffixes on dB.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 02:33:48 pm
content: Quote from: tggzzz on October 23, 2024, 02:25:44 pmWe now have dB police!So, all those physicists using Si units are relegated to eternal confusion? It's a wonder I even made it through all those years of university.To me it's not traditional. I've never used those suffixes and, until now, I have never needed to. So, let's make a deal. You do you and I'll do what I've always done. Would that be okay?Edit: I don't "dislike" the usage. I just don't use suffixes because they are entirely unnecessary.

author: radiolistener
author_rank: Super Contributor
timestamp: October 23, 2024, 02:57:51 pm
content: Quote from: BillyO on October 23, 2024, 02:33:48 pmAdding a postfix clarifies the context, helping others understand which dB reference is being used.For example, dBFS refers to decibels relative to the full scale of an ADC or DAC, while dBc refers to decibels relative to the carrier.Both represent decibels but in different contexts it means different values.

author: coppice
author_rank: Super Contributor
timestamp: October 23, 2024, 03:01:16 pm
content: Quote from: radiolistener on October 23, 2024, 02:57:51 pmEven with something like dBFS there is some vagueness in its meaning. I have seen it used for full scale sine wave and for full scale square wave. The ITU define it as full scale square wave in their standards documents, but not everyone follows their definitions.

author: radiolistener
author_rank: Super Contributor
timestamp: October 23, 2024, 03:18:06 pm
content: Quote from: BillyO on October 23, 2024, 02:55:27 amThis is incorrect. The human ear has a nonlinear frequency response, and its sensitivity varies depending on the frequency. To fully cover the ear's entire dynamic range across all frequencies with a linear DAC, the DAC would need a dynamic range exceeding 140 dB. To my knowledge, no such DAC currently exists.Theoretically, you could use a DAC with a little bit lower dynamic range by applying frequency corrections corresponding to the ear's sensitivity. However, this would probably be no easier than designing a DAC with a 140 dB dynamic range.Here is average human ear dynamic range:As you can see, in order to cover it for all audible frequencies (not only for 1 kHz), the DAC would need to cover from -10 dBSPL to +135 dBSPL. This is about 145 dB dynamic range.

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2024, 03:25:45 pm
content: Quoting BillyO:'Suffixes are not a part of the SI units. dB is an SI unit, dBc is not. I guess it's a matter of how you were educated, but one should really not go around trying to "correct" someone just because they are not following whatever "convention" you preferTell you what, don't call me out for using dB and I won't call you out for using dBc, or whatever other suffix you want to use (which are essentially meaningless if the subject of discussion is clear).'From Wikipedia:"In April 2003, the International Committee for Weights and Measures (CIPM) considered a recommendation for the inclusion of the decibel in the International System of Units (SI), but decided against the proposal. However, the decibel is recognized by other international bodies such as the International Electrotechnical Commission (IEC) and International Organization for Standardization (ISO). The IEC permits the use of the decibel with root-power quantities as well as power and this recommendation is followed by many national standards bodies, such as NIST, which justifies the use of the decibel for voltage ratios. In spite of their widespread use, suffixes (such as in dBA or dBV) are not recognized by the IEC or ISO."The "dB" is not an actual SI unit, but is well recognized internationally.IEC and ISO recognize "dB" as a measure of ratios.Even though they do not recognize suffices, careful writers need to specify the reference when quoting a value in dB, and the suffix is a useful format.Without calling out the reference in words or suffix, "dB" alone is not sufficient to quote a value (that otherwise would be in Volts or Watts) without confusion.Remember that when describing ratios of monetary quantities, always use the factor 10, not 20, since money is power.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 03:32:26 pm
content: Quote from: TimFox on October 23, 2024, 03:25:45 pmBut to the point, I doubt I will ever use any suffix with dB. As I said, I never have, nor had to so out of force of habit I probably won't. Some new tricks are beyond old dogs.

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2024, 03:50:03 pm
content: When writing carefully, remember the difference between "dBm" and "dBu".The former is a power ratio with respect to 1 mW in whatever impedance is in use.The latter is a voltage ratio, independent of impedance, with respect to 0.775 V, which would produce 1 mW in a 600 ohm load (common for audio applications, not RF).Traditional AC voltmeters have a high input impedance, such as the -hp- 400 series, but were often calibrated in terms of dBu, but often stated as dB w.r.t. 1 mW/600.Audio amplifiers and signal transformers are often quoted in dBu for performance and operating specs.If you want to join the "dB police", you should consider the IEC's rationale for disliking suffices: "unacceptability of attaching information to units"; their preferred notation would beLx(re xref) or as Lx/xrefwhich I have never encountered in my long life.

author: radiolistener
author_rank: Super Contributor
timestamp: October 23, 2024, 03:56:27 pm
content: Quote from: Andy Chee on October 23, 2024, 03:36:08 amNo, that is not enough. See above for details. Ideal 16-bit DAC (which doesn't exists in reality) has SNR=16*6.02+1.76 = 98 dB. The real 16-bit DAC will be always worse than that. But human ear is able to listen for sounds within 145 dB dynamic range.DAC with SNR=98 dB is just unable to cover 145 dB range. While it may be enough to listen the music, it don't cover full audible range of human ear.Regarding to the Nyquist limit, the same is not enough. And it is more critical than 16-bit resolution. Because 44 kHz sample rate is enough to reproduce cosine 22 kHz wave only, but it is not enough to reproduce sine wave at 22 kHz. If you put 22 kHz sine wave on 44 kHz DAC, you will get DC output instead of sineThe same for other non cosine phase carriers at high frequency - their amplitude will be significantly distorted.

author: coppice
author_rank: Super Contributor
timestamp: October 23, 2024, 04:15:12 pm
content: Quote from: Andy Chee on October 23, 2024, 03:36:08 amActually 16 bit was chosen because they couldn't get beyond about 14 bits at the time, and didn't expect to get beyond 16 bits any time soon. It turns out to be adequate, if a bit marginal, for human hearing. At any moment human hearing can't hear that big a range, but hearing adapts. A long quiet passage in a piece of music gives your hearing time to adapt, and you can start to hear issues. 16 bits only works well now we have a good understanding of dithering. If you don't dither the material well, those long quiet passages really get compromised. The CD format was chosen at a time when dithering had not been properly studied and understood. As for 44.1ksps, it was a compromise, because of engineering limitations of the day. 44.1ksps requires a real brick wall filter to give you 20kHz flat bandwidth, and phase gets screwed around with at the top of the band. Does that matter? Dunno, but everything after went to 48ksps, to get a nice flat 20kHz bandwidth with less aggressive filtering.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 04:26:20 pm
content: Quote from: radiolistener on October 23, 2024, 03:18:06 pmI was talking in context of hearing distortion. Distortion does not exist on it's own, it refers to abnormalities in a signal. In tis case sound. So, what I was getting at is distortion in a sound can not generally be heard if it is more than -80 dB down from the sound itself. The same is generally true for noise.

author: radiolistener
author_rank: Super Contributor
timestamp: October 23, 2024, 04:31:56 pm
content: Quote from: coppice on October 23, 2024, 04:15:12 pmThe issue here is not only related to the filter slope sharpness but also, and more importantly, to amplitude distortion for signals whose phase does not exactly match the phase of the cosine. The amplitude of such signals undergoes significant distortion, especially as the frequency approaches the Nyquist limit and the phase deviates further from the cosine phase.As for the reconstruction filter slope sharpness, such a narrow transition band is indeed insufficient for designing an adequate filter, especially considering physical limitations. From this perspective, even 48 kHz, 96 kHz, and even 192 kHz are not sufficient.

author: Andy Chee
author_rank: Super Contributor
timestamp: October 23, 2024, 04:43:52 pm
content: Quote from: radiolistener on October 23, 2024, 03:18:06 pmConsider this.If one has audio material that is capable of exploiting the complete dynamic range of 140dB, a listener with the;a) volume turned up for the quiet sounds, will probably have their eardrums destroyed by the loud passages, orb) volume turned down for the loud sounds, will be unable to hear the quiet passages.Tchaikovsky's 1812 Overture with gunfire/cannon fire might test that dynamic range capability, but other than that, I'm not sure what will.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 04:45:29 pm
content: Okay, dB is not an SI unit (mainly because it's not actually a unit), but it's use is acceptable under SI whereas something like dBc or dBm is not.Quote from: TimFox on October 23, 2024, 03:25:45 pmIf I were talking about the gain of an audio amplifier and I said "This amplifier has a voltage gain of 10dB" would you be confused? What if I said something like "If I re-bias the output section of this amplifier like this (insert schematic here) the power will increase by 5dB." would you be confused? If I said "Replacing the output transistors with (insert transistor number here) will lower the THD by 10dB" would you be confused?Generally, discussing the properties of something is usually difficult without some mention of the properties. Wouldn't you agree?

author: coppice
author_rank: Super Contributor
timestamp: October 23, 2024, 04:47:29 pm
content: Quote from: radiolistener on October 23, 2024, 04:31:56 pmProve it.

author: BrianHG
author_rank: Super Contributor
timestamp: October 23, 2024, 04:47:47 pm
content: Quote from: BillyO on October 23, 2024, 05:46:39 amHere you go, 64bit windows install:https://qalculate.github.io/

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 04:49:01 pm
content: Quote from: BrianHG on October 23, 2024, 04:47:47 pmThank you!

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2024, 05:00:55 pm
content: Quote from: BillyO on October 23, 2024, 04:45:29 pmThe gain of an amplifier is a pure (dimensionless) ratio, and “dB” is a proper unit to measure the ratio.Similarly, when increasing or decreasing a ratio, “dB” alone is appropriate.As I wrote, when quoting the magnitude of a distortion product, careful writing requires the reference (denominator) of the ratio, so “dBc” is appropriate. Similarly, when expressing the magnitude of a voltage or power, “dBV” or “dBm” is appropriate (respectively).

author: tggzzz
author_rank: Super Contributor
timestamp: October 23, 2024, 05:12:56 pm
content: Quote from: BillyO on October 23, 2024, 02:33:48 pmYour experience appears limited; in itself that isn't an issue sinceeverybody'sexperience is limited.The suffix is a common and succint way of expressing what the 0B reference level is (and yes, I mean "B", not "dB"!)Spectrum analyser: dBm used three times, on an output, an input and the screenSignal generator power outputBalanced mixer IP3, IP1, LO drive

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 05:25:47 pm
content: Quote from: tggzzz on October 23, 2024, 05:12:56 pmDude?! Where did I say suffices are not in use? What I actually said was I don't use them and they are not necessary. All the datasheets and instrument panels in the universe won't change that, or me.And what in heck does all that have to do with experience?Look, everyone, if you want to use a suffix to express yourself go right ahead. Please. I won't stop you.Can we be done with this inane discussion at this point?Test, which are more concise?-110dBm or 10fW+30dBm or 1W-10dBm or .1mW

author: radiolistener
author_rank: Super Contributor
timestamp: October 23, 2024, 05:27:08 pm
content: Quote from: BillyO on October 23, 2024, 04:26:20 pmI just tested it with headphones, the distortion at the level of -60 dBc is quite loud and distinct. Distortion at -80 dBc is barely audible, and you have to listen carefully to hear it. At -100 dBc, it’s practically inaudible.However, it all depends on the specific frequency combination. For example, I tested it with a 10 kHz carrier and ±700 Hz distortion, and for that combination, my hearing threshold is around -90 dBc. However, when listening to a 1 kHz carrier with ±100 Hz distortion, the hearing threshold is noticeably worse. So, for some frequency combinations, a dynamic range of 80 dB may be sufficient, while for others, even 100 dB might not be enough.I once experimented with different frequency combinations and clearly remember that at certain frequencies I could hear distortion at the level of -100 dBc and this is not the best result, it is possible to listen even more weak distortions.

author: tggzzz
author_rank: Super Contributor
timestamp: October 23, 2024, 05:59:06 pm
content: Quote from: BillyO on October 23, 2024, 05:25:47 pmSee the context in my post, which you have chosen to snip in order to (try to) make a point.QuoteWhen conversing, it is normal to havenomenclature in commonin order to quickly and unambiguously convey information.That isn'tnecessary; it is quite correct to express temperature in Fahrenheit or Rankine, or velocity in furlongs/fortnight, or time in nanocenturies (1 nanocentury is ~pi seconds), or distance in attoparsecs (1 attoparsec is ~1inch)But it is helpful to use common nomenclature.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 06:08:09 pm
content: Quote from: tggzzz on October 23, 2024, 05:59:06 pmWrong. I snipped it to keep these threads from being 12 miles long. The reference to your post is still there and if anyone wants to click on it they can feel free.

author: dietert1
author_rank: Super Contributor
timestamp: October 23, 2024, 06:09:26 pm
content: When i did some digital audio development 10 years ago, i used a good sound card at 24 bit/96 KHz with some RTA software package (ARTA). Such a signal chain will be better than anything you can get as loudspeaker or microphone. We do have some servo-controlled subwoofers that really work down to 13 Hz with little harmonic distortion.In this context the human ear is the worst of all - like it should be.E.g. a calibrated measurement microphone will do a harmonic distortion test at 10 KHz while the human ear won't. I think nowadays high quality digital audio and video is a non-issue, unless you try to use some vintage crap like that rare Sony DC-coupled active speaker..Regards, Dieter

author: David Hess
author_rank: Super Contributor
timestamp: October 23, 2024, 06:09:38 pm
content: Quote from: coppice on October 23, 2024, 04:15:12 pmThe best suitable converters now achieve about 18.5 (roughly 0.00046%) effective bits, which is a real accomplishment. I did not know they had gotten that good and thought they were still below 18 bits. The best old converters might achieve 15.5 (roughly 0.0016%) effective bits.QuoteThat could be the case, however achieving 18.5, or even 15.5 bits, of noise and distortion performance out of the analog signal chain before an ADC or after a DAC is somewhere between difficult and almost impossible. And then as pointed out earlier, the speaker contributes orders of magnitude more harmonic and intermodulation distortion anyway.QuoteEverything went to oversampling, moving the brick wall filter into the digital domain on the ADC or DAC and considerably relaxing the requirements of the analog anti-aliasing filter.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 06:13:38 pm
content: Quote from: tggzzz on October 23, 2024, 05:59:06 pmRight. I get what you saying. Watts are such uncommon nomenclature. Watt was I thinking!

author: ssashton
author_rank: Frequent Contributor
timestamp: October 23, 2024, 09:46:21 pm
content: I have never seen dBc used when expressing a measurement of distortion in audio systems. Not in datasheets, books or equipment like AP or R&S analysers. They just assume the user / reader knows the distortion metric is relative to the stimulus.

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2024, 09:56:15 pm
content: Actually, the metric is relative to the response, not the stimulus.For dBc as a distortion metric, seehttps://www.analog.com/en/resources/analog-dialogue/articles/confused-about-amplifier-distortion-specs.htmlYou need to read more if you have never seen this usage for distortion discussions.

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 10:35:30 pm
content: Quote from: TimFox on October 23, 2024, 09:56:15 pmHe also says in that article that it can expressed a dB.Anyway, if say we are looking at the ratio of the 2nd (V2) harmonic to the fundamental (Vf), like I was originally doing, then you are looking at V2/Vf and you have a dimensionless ratio. So to say "The 2nd harmonic is -120dB down WRT the fundamental" (my original argument) is just fine and is not further clarified by saying "The 2nd harmonic is -120dBc down WRT the fundamental".You'll also note in that article that when he shows the graph for the THD of the AD797, the THD is given in dB not dBc. I know it shows dBc for the AD9620, but all that demonstrates is that AD do not consistently prefer one over the other and both are fine because in any discussion around the parameters of a device (such as THD) every one knows what you are talking about unless you have completely botched the discussion.The only times a suffix may be needed is when you are talking about absolute values, not relative values, and there are (in my opinion) better ways to identify absolute values for things like power, voltage and noise. Like volts and watts.His further analysis could just as easily have been expressed using a logarithmic power scale in mW or whatever unit you find convenient. dB or dBm are just an arbitrary logarithmic scale adopted by engineers because - history. There is no mathematical or physical need for dB(plus whatever suffix you like).

author: TimFox
author_rank: Super Contributor
timestamp: October 23, 2024, 10:41:58 pm
content: One doesn’t say “the second harmonic is 100 dBc below the fundamental” (an incorrect statement).One says “the second harmonic is -100 dBc” (a compact correct statement), or“the second harmonic is 100 dB below the fundamental” (a less compact correct statement).

author: radiolistener
author_rank: Super Contributor
timestamp: October 23, 2024, 11:05:24 pm
content: Quote from: BillyO on October 23, 2024, 10:35:30 pmif you use dBc unit, it don't needs to duplicate information that this is relative to the carrier.So, the proper way to say it - "The 2nd harmonic is -120dBc."

author: BillyO
author_rank: Super Contributor
timestamp: October 23, 2024, 11:27:48 pm
content: Right.But let's not strawman this, You both know what I'm saying. I'll mention that once more. You don't need to add a suffix to dB. IF you want to, go ahead. I don't do it.

author: TimFox
author_rank: Super Contributor
timestamp: October 24, 2024, 03:07:35 am
content: When quoting a magnitude using dB, you need to specify a reference.Suffices are a compact way to do it.Otherwise, you need to state it explicitly (e.g., "dB with respect to 1 mW").You don't need to use dB, but you need to understand common usage.

author: Analog Kid
author_rank: Super Contributor
timestamp: October 24, 2024, 03:15:27 am
content: Suffixes.

author: deadlylover
author_rank: Frequent Contributor
timestamp: October 24, 2024, 04:11:48 am
content: I only see dB suffix use when talking about signal levels, but never for distortion, it's kind of just assumed that the reference is the input.Example with three of my analysers. They just use dB as an alternative to %.

author: Vovk_Z
author_rank: Super Contributor
timestamp: October 24, 2024, 07:24:08 am
content: Quote from: Korchahin on October 21, 2024, 10:17:33 pmI ended my search for an ideal sine when I bought a -140 dB Vicnic sine generator (from Vicnic itself). It is perfect and already covers all my real and possible needs. You just may want to add to it a battery-powered power supply, and that's it.

author: Smokey
author_rank: Super Contributor
timestamp: October 24, 2024, 07:51:13 am
content: Quote from: radiolistener on October 23, 2024, 03:18:06 pmThat's an interesting plot, but unless you are talking about an "ideal" human you better also specify theageof the person. I worked at a place with a bunch of old engineers and they used to call me in and ask if I could hear the high frequency servo hum since they no longer could.

author: MrAl
author_rank: Super Contributor
timestamp: October 24, 2024, 09:11:34 am
content: Quote from: SteveThackery on October 21, 2024, 02:44:17 pmHiYes, but a stepped wave is harder to produce while PWM is easier to create and is used in almost all pure sine converters.The harmonic content of a PWM sine would have less THD to start with so less to filter out. Usually the PWM pattern is designed to reduce or eliminate the lower harmonics so smaller components can be used to filter the higher harmonics.It's an interesting field I used to work in that industry. The converters I designed and tested were high power pure sine converters.

author: MrAl
author_rank: Super Contributor
timestamp: October 24, 2024, 09:19:03 am
content: Quote from: Korchahin on October 21, 2024, 03:32:54 pmHi,The references to human hearing should be taken as casual rather than hard core because when we do testing on audio equipment, we look for perfection and any deviation from that perfection so we can accurately state what it is doing. We have no control over who is listening, but we do have control over the quality of our audio systems so it does not make sense to say that just because people have a wide variation of audio perception that we should not care about trying to obtain that perfection, and more importantly to be able to specify how far it is from perfection. That's what audio design is all about, and a piece of test equipment should be the very best if possible. Down the road there may be cost tradeoffs, but it has nothing to do with human hearing variations.

author: SteveThackery
author_rank: Super Contributor
timestamp: October 24, 2024, 09:21:51 am
content: Quote from: MrAl on October 24, 2024, 09:11:34 amThanks for the reply,@MrAI. That is fascinating and I'm slightly amazed. So a PWM-generated sine wave has less harmonic content than the stepped output of a (say) 8- or 10-bit DAC? What kind of filtering is needed to extract a sine wave from a PWM signal? Do you know of somewhere I can read more about this topic?

author: radiolistener
author_rank: Super Contributor
timestamp: October 24, 2024, 02:02:40 pm
content: Quote from: SteveThackery on October 24, 2024, 09:21:51 amNo. PWM is just a kind of 1-bit DAC. More bits leads to less harmonics amplitude, so 8 or 10 bit DAC output will be better than 1 bit.

author: TimFox
author_rank: Super Contributor
timestamp: October 24, 2024, 02:04:44 pm
content: From Fourier series analysis, you can theoretically null out a given harmonic by appropriate symmetry of a stepped or other waveform.The simple example is that an ideal square wave (with perfect time symmetry) has zero even-order harmonics.

author: Korchahin
author_rank: Regular Contributor
timestamp: October 24, 2024, 03:14:20 pm
content: While researching neurophysiology, I came across an interesting feature. For the most part, human hearing works as a comparator or differential amplifier. When listening to mono sound, we perceive little distortion. With a mono sound source, we can perform a responsiveness test as follows: We generate a signal with a frequency of, for example, 400Hz and a capacity of 2.83V RMS / 8 Ohm (1W?). Next, we add a periodic short signal to the signal, for example 1 kHz but with a level of -100 dB in relation to the main one (in our case it is 400 Hz). And we raise the volume level of the additional periodic signal until we hear it against the background of the main signal. Can this be taken as a way to measure the dynamic range of what is perceived by the ear?But the second test is more interesting. And it represents differential perception or sensitivity to phase distortions or changes. This is the so-called "stereo sound". This is precisely what “Audiophiles” most often focus on.The peculiarity is that the sensitivity to the phase of the signal between the left and right ear is many times greater than to the unevenness of the signal relative to the frequency response. For example, we can easily detect the place where a coin accidentally fell from a coin and even hear exactly where it rolled. Or it’s very good to localize the location of a traffic light based on a signal for people with vision problems. It is necessary to organize a test for changes in signal level and signal phase between the left and right ears. For now, I am only planning to analyze and statistics of objective indicators of dynamic range sensitivity and differential sensitivity. But I can definitely say that you need to focus on “stereo” because in this case, hearing is much more accurate.But I want to draw your attention to the fact that physical auditory perception is not relevant to the purpose of this topic. Of course, I will not hear THD distortion relative to a signal below 100dB. But this is not about what I hear, because this is subjective. And what I can measure, objective measurements. And only the objective interests me.For what? Sports interest!p.s. The text was translated into English via Google Translate and I am not responsible for any inaccuracies in the translation.

author: Andy Chee
author_rank: Super Contributor
timestamp: October 24, 2024, 03:38:05 pm
content: Quote from: Korchahin on October 24, 2024, 03:14:20 pmOk if measurement is your goal, then one of the most important aspects of this experiment is NOT the performance of your constructed device, but the performance of your testing equipment.If your test equipment can only measure -50dBc, then logically your constructed device may have a minimum of -50dBc performance, but NOT necessarily the LOWEST distortion, which was your goal in our opening post. Your constructed device may be capable of -100dBc, but without good test equipment to check, you'll never know.If your equipment can measure -140dBc, maybe your constructed device is -180dBc? But you'll never know.If your equipment can measure -190dBc, maybe your constructed device is -200dBc? But you'll never know.In summary, if you're interested in objective measurements, forget about "lowest distortion" sine generator, and think about lowest distortion measuring/test equipment.

author: TimFox
author_rank: Super Contributor
timestamp: October 24, 2024, 03:54:57 pm
content: In a THD or SINAD measurement, "residual distortion" is the combination of the source's distortion and the sensitivity of the detector (spectrum analyzer or fundamental-rejection filter, including its distortion and noise level).It’s what you measure with a wire from source to analyzer.This should be smaller than the actual distortion of the unit under test.When using an -hp- 339A distortion analyzer (with built-in low distortion source), I find that a typical amplifier's measured THD increases with increased output, looking like 2nd-order at medium outputs but with 3rd-order appearing at higher outputs, then increasing dramatically as the unit starts to "clip" near its maximum possible output.When graphing THD vs output, 2nd-order increases linearly (expressed as fractional THD) and 3rd-order increases as the output voltage squared.At moderately low levels, the THD fraction reaches a minimum value that corresponds to the residual distortion of the test system.Below that level, the THD appears to increase as the frequency decreases.If the amplifier does not have crossover distortion, this increase in measured THD is actually the noise of the amplifier divided by decreasing output level.(On a spectrum analyzer, one would see the signals fall below the noise floor on the display.)Specifically, these measurements were done on a class-A single-ended audio preamplifier, using discrete vacuum triodes with local and global feedback.The 339A uses a nulling filter (fancy Wien bridge) with servo tuning to minimize the filter output, then measures the RMS output after the filter and scales it to the signal before the filter (using analog circuitry).For detailed work, one can monitor the filter output on an oscilloscope or spectrum analyzer to see the harmonics separately.Many (maybe 45) years ago, I built a transistor RIAA preamplifier and wanted to measure its distortion. All I had for test equipment were a decent Heathkit generator (spec 0.1% THD) and an ancient -hp- vacuum-tube THD meter (also spec’ed at 0.1%). I was surprised that the THD at the preamp output measured better than with a direct connection, until I realized that the RIAA curve is a low-pass filter and the test system was dominated by the generator harmonics.

author: langwadt
author_rank: Super Contributor
timestamp: October 24, 2024, 04:27:51 pm
content: Quote from: TimFox on October 24, 2024, 02:04:44 pmthat's the point of Don Lancasters "magic sinewaves"https://www.tinaja.com/magsn01.shtml

author: BrianHG
author_rank: Super Contributor
timestamp: October 24, 2024, 05:10:41 pm
content: No one yet has offered the solution of using a normal 5$ 24bit audio dac tied to a MCU, generating its purest possible sine wave at the target 1khz rendered at a 96 or 192 Khz sampling rate. (some 192khz capable dacs perform slightly better when feeding them a 96khz sample rate...)----then-----Feeding that DAC's output through a narrow band 1khz analog filter with a super quality opamp driver output.Doing this at high voltage, like:Amplify the DAC to 26vpp -> analog 1khz filter -> another opamp buffer -> resistor output divider down to 1vrms.For studio broadcast equipment, to purify our reference IF generator's spectrum, we used to filter them with high Q notch filters, even saw filter elements.

author: dietert1
author_rank: Super Contributor
timestamp: October 24, 2024, 06:25:33 pm
content: I once made that DAC you describe using two small ES9023 24-bit audio DAC modules plus a Toslink SPDIF receiver + some trick to feed digital audio of reverse polarity into the second DAC. Output is medium level differential audio, perfect for driving a pro amplifier.Concerning that 1 KHz filter i am not convinced further analog processing can improve the signal. Those integrated audio DACs have become pretty much perfect nowadays. Though we never now what happens inside. Some people suspect they are using floating point type methods, that is a combination of DAC + PGA. There is a faction of audiophools who swear on using a vintage R/2R DAC.Regards, Dieter

author: TimFox
author_rank: Super Contributor
timestamp: October 24, 2024, 06:29:17 pm
content: The OP only asked for a low-distortion source, but an appropriate analyzer is also required: first to verify the source and second to measure the output of the circuit being tested.

author: Korchahin
author_rank: Regular Contributor
timestamp: October 24, 2024, 06:55:23 pm
content: Quote from: Andy Chee on October 24, 2024, 03:38:05 pmI've already thought about it.Today this is "E1DA Cosmos ADCiso" - the best and lowest noise ADC in the audio range with self-noise less than -150dB and THD <-128dB.I am inclined to follow the same path as the author of the ADC and those suggested by the forum members here, namely: Use a high-quality DAC + LPF.https://www.diyaudio.com/community/threads/cosmos-apu-a-notch-lna-70-to-outperform-apx555b-for-30-000.386001/page-39#post-7824223

author: Smokey
author_rank: Super Contributor
timestamp: October 24, 2024, 08:56:32 pm
content: Quote from: Korchahin on October 24, 2024, 06:55:23 pm..... Um... Do you know what forum you are posting on? Hah!https://boizoff.com/language/en/e1da-cosmos-adciso-analog-to-digital-converter-review/

author: TimFox
author_rank: Super Contributor
timestamp: October 24, 2024, 09:03:00 pm
content: To improve a THD measurement using a good ADC, a passive Wien bridge or similar fundamental rejection filter ahead of the ADC will reduce the required dynamic range.

author: dietert1
author_rank: Super Contributor
timestamp: October 24, 2024, 11:06:05 pm
content: As i wrote above, modern digital audio interfaces with their typical 120 dB dynamic range are good enough for any practical application. Even if we don't consider the faults of human hearing, typical THD reached by microphones or very good speakers won't be better than 0.01 %. So a 120 dB dynamic range is roughly 100x better than necessary. There might be other applications for a larger dynamic range, e.g. metrology, but audio isn't.Regards, Dieter

author: TimFox
author_rank: Super Contributor
timestamp: October 24, 2024, 11:11:13 pm
content: As many have responded, the OP wants an ideal source to evaluate quantitatively the performance of low-distortion devices.120 dB dynamic range is certainly sufficient to cover actual musical recordings, but that's a different question.

author: MrAl
author_rank: Super Contributor
timestamp: October 24, 2024, 11:36:02 pm
content: Quote from: SteveThackery on October 24, 2024, 09:21:51 amHi,I don't think I said that a PWM generated wave has less THD than a stepped wave, but I did say that a PWM generated wave is easier to generate than a stepped wave, but that's mostly when power output is relatively high, and also we don't need a DAC to generate PWM.It seems however that you are just concerned with generating a test signal rather than a high power sine wave output. This is basically a different application which probably require an entire new analysis of the situation given the DAC is very flexible, and there is the possibility that a stepped wave combined with PWM will produce an even better result than either one alone. I guess now it comes down to how complicated you want the circuit to be, or at least the program that drives the DAC if you still want to include that.For PWM alone you may want to look up the "Magic Sinewaves" formulas posted before this post.The simpler technique is to just calculate the average value at several instantaneous values of a sine wave and make the pulse width conform to that average. The peak amplitude would be controlled via the amplitude of the pulses, but you probably don't need that.This is probably not relative to your application, but I am thinking that if we did use a DAC for high power output we may be able to use a regular switching regulator to boost the output power by allowing the output of the switcher to change based on the DAC output. Normally we want a single output voltage, but with the DAC acting as the reference signal, the output of the switcher would be able to follow the DAC. That would eliminate the requirement for a linear regulator which would pull efficiency way down to the point where it would be no where near practical.As to using the DAC plus the PWM, I think that would be a new area unless we can find a paper where someone has done that before and come up with generalization for some applications.We might also compare, for signal generation only, a DAC output THD vs a PWM output THD just for the fun of it. When low (signal) power is needed we have more options. The Magic Sinewaves would be more for higher power applications, although it may also work to some degree for signal generation.For signal generation, I think you would need to specify what your DAC can do, and what controlling it can do.For the DAC it would be speed and the number of bits, and for the controller (probably a microcontroller) the speed after considering the number of bits that have to be output to drive the DAC also. The speed of the microcontroller would be the speed that it can change from one bit set to the next, not really the clock speed. For example, if the DAC required 8 bits, then the speed of the microcontroller would be how fast the output can change from say code 0x12 to say 0x34. If it required 16 bits, then how fast it can change from say 0x1234 to 0x5678 (or any other two 16 bit codes).This is an interesting area of borderline analog/digital which I have not gotten deep into for quite a long time now. It might be interesting for me to take a fresh look.

author: SteveThackery
author_rank: Super Contributor
timestamp: October 25, 2024, 10:13:21 am
content: Quote from: MrAl on October 24, 2024, 11:36:02 pmEarlier on you said:Quote from: MrAl on October 24, 2024, 09:11:34 amAnyway, no matter. Thank you for your explanations. By the way, I should point out that I'm not the OP, but rather a keen-to-learn bystander.

author: radiolistener
author_rank: Super Contributor
timestamp: October 25, 2024, 12:43:32 pm
content: Quote from: MrAl on October 24, 2024, 11:36:02 pmThis is not new, see multi-bit ΔΣ DAC.For 1-st order ΔΣ modulator you can estimate it as:SNR = 6.02*N + 1.76 - 5.17 + 30*log10(OSR)whereN - bitsOSR - oversample ratioHigher order ΔΣ modulators have more interesting noise performance, but they also have artifacts due to instability issues.For 2-nd order ΔΣ modulator you can estimate it as:SNR = 6.02*N + 1.76 - 12.9 + 50*log10(OSR)Here is my octave script which shows how it works:Code:pkg load signal;% ParametersFs = 16000; % Sampling frequency of input signalBITS = 16; % Input signal resolution in bitsFsig = 1000; % Frequency of the input signal (1 kHz)OSR = 32; % Over Sample Ratio for DSMN = 4; % N-bit DSM% Derived parametersTs = 1 / Fs; % Sampling periodFosr = Fs * OSR; % Oversampled frequencyTosr = 1 / Fosr; % Oversampled period% Time vectors for input and oversampled signalst = 0:Ts:2/Fsig; % 2 periods of the input signalt_osr = 0:Tosr:2/Fsig; % Oversampled time vector for 2 periods% n-level quantizerfunction quantized_output = quantize(signal, range, n)min = range(1);max = range(2);scale = max-min;% Scale from [min, max] to [0, 1]normalized_signal = (signal - min) / scale;% quantize [0, 1] for n levelsquantized_output = round(normalized_signal * (n - 1)) / (n - 1);% Scale back from [0, 1] to [min, max]quantized_output = quantized_output * scale + min;end% Generate input sine waveinput_signal = sin(2 * pi * Fsig * t);% Quantize input signal (zero-symmetric)input_signal_quantized = quantize(input_signal, [-1, 1], 2^BITS - 1);%input_signal_quantized = input_signal;% 1-st order DSMerror = 0;output_dsm = zeros(1, length(t_osr));for i = 1:length(t_osr)current_input = interp1(t, input_signal_quantized, t_osr(i), 'linear', 'extrap');signal = current_input - error;quantized_output = quantize(signal, [-1, +1], 2^N);error = quantized_output - signal;output_dsm(i) = quantized_output;end% Low-pass filter to reconstruct the analog output% Use 4th order Butterworth filter with cutoff at 1/OSR[b, a] = butter(4, 1 / OSR);output_filtered = filter(b, a, output_dsm);% Scale the filtered output to match the input signal amplitudeoutput_filtered = output_filtered * max(input_signal_quantized) / max(output_filtered);% ===Plot results===% Time domain analysis (wave)figure;hold on;grid on;grid minor;plot(t_osr(1:length(output_dsm)), output_dsm, 'r', 'LineWidth', 1, 'DisplayName', 'DSM Output');plot(t, input_signal_quantized, 'b', 'LineWidth', 3, 'DisplayName', 'Input Signal');plot(t_osr(1:length(output_filtered)), output_filtered, 'g', 'LineWidth', 1.5, 'DisplayName', 'Filtered Output (DAC)');ylim([-1.05, 1.05]);legend('show');xlabel('Time (s)');ylabel('Amplitude');title(sprintf('Delta-Sigma Modulator DAC, N=%d, OSR=%d', N, OSR));hold off;

author: Korchahin
author_rank: Regular Contributor
timestamp: October 25, 2024, 02:06:04 pm
content: Quote from: radiolistener on October 25, 2024, 12:43:32 pmVery interesting. Thank you for the code, as a programmer, it is sometimes easier for me to read and understand the principle of operation than the explanations of some people)))On occasion, it will be necessary to measure the THD of the sinusoid generated by the DAC using the DSD format. There's something like Pulse Density Modulation and how it will affect the result.

author: MrAl
author_rank: Super Contributor
timestamp: October 25, 2024, 02:29:24 pm
content: Quote from: SteveThackery on October 25, 2024, 10:13:21 amHi,Just to note, you can't take sentences out of context like that and then say something is comparatively wrong between the two.When I said the content of a PWM would have less THD to start with, it was within the context of a square wave signal NOT a DAC output.In other words, an appropriate PWM has less THD to start with than a square wave.

author: MrAl
author_rank: Super Contributor
timestamp: October 25, 2024, 02:36:18 pm
content: Quote from: radiolistener on October 25, 2024, 12:43:32 pmHello there,Just to note, that sounds like another statement about something taken out of context.My statement was not about combining PWM with a DAC in just any general way, it was combining them in a very specific way that was relevant to the current application.In other words, using (maybe first) the DAC to create amplitude levels that vary, then taking each of those levels and PWM'ing them also.Alternately, perhaps starting with a PWM, then also changing the levels of the different pulses so EACH pulse has multiple levels.The first method is probably the best, and the advantage would presumably be less switching transitions per quarter wave for an equivalent THD level.So you see this has nothing to do with a delta sigma (or a variant) modulation technique.I am tempted to draw some diagrams of each method.

author: coppice
author_rank: Super Contributor
timestamp: October 25, 2024, 02:41:36 pm
content: Quote from: radiolistener on October 25, 2024, 12:43:32 pmAre you trying to equate PWM with ΔΣ? They have very different characteristics. ΔΣ largely behaves in a signal independent manner. Its response rolls off heavily at the top of the band, in manner that is determined by the filtering you choose. This needs to be compensated for by further filtering, if you want a flat response. A lot of applications live with the rolled off response, as its cheaper, and has a lot lower latency. PWM, on the other hand, has a frequency response which is very quirky. When its producing something close to a square wave you basically have a ZOH, and when its producing narrow pulses you have something closer to dirac impulse sampling. The frequency response is changing all the time, creating distortion. That's one of the reasons modern class D amps are not simple PWM designs, but have additional complexity to mitigate the quirkiness.

author: temperance
author_rank: Super Contributor
timestamp: October 25, 2024, 03:38:49 pm
content: The illusions of some days cast in a golden light.Did you read Douglas Self On Audio? You probably did because you sound like you are after improving on it. This has been done perhaps ten years ago by Analogspiceman and B. Putzeys by means of a fully differential amplifier.Amplifier distortion has become irrelevant with distortion figures easily below 0.05% without to much effort. Transducers are and will probably be a problem for many decades. (Although some good transducers do exist like some mid-range speakers meant for pro audio line array systems.) Transducer problems are extremely hard to solve and a very expensive adventure in tools and equipment and an exercise in unlimited perseverance. New cone materials are being introduced every year and brought to you as the next walhalla in speaker cones. But many of those attempts are much like anti wrinkle creams with exotic substances of questionable performance for the ladies. More often then not the improvement in one area banishes the performance in an other area. Some of the best speakers use "ordinary" paper cones.

author: radiolistener
author_rank: Super Contributor
timestamp: October 25, 2024, 04:09:40 pm
content: Quote from: Korchahin on October 25, 2024, 02:06:04 pmMatlab has a functionthd(x,fs,n)which measures THD for provided sample.Unfortunately octave don't have such function. I wrote this simplified version for octave:Code:function [THD_dB, harmonic_power_dB, harmonic_freq] = thd_calc(signal, Fs, n)% Function for calculating THD in dBc and harmonic powersif nargin < 2Fs = 1;endif nargin < 3n = 6;endN = length(signal);spectrum = abs(fft(signal)) / N;spectrum = spectrum(1:N/2+1); % consider only positive frequenciesfreqs = (0:N/2) * Fs / N;% find the fundamental frequency f1 by the maximum peak in the spectrum%[~, idx_f1] = max(spectrum); % find index of max value%f1 = freqs(idx_f1); % frequency% better versionmax_value = max(spectrum); % find max valuethreshold_dB = 0.1;% Find all peak indices that differ from the maximum by less than threshold_dB dBidx_f1_all = find(spectrum >= max_value / 10^(threshold_dB / 20));%idx_f1_all = find(spectrum == max_value); % find all indices with this valueidx_f1 = min(idx_f1_all); % get index with min frequencyf1 = freqs(idx_f1); % frequency% Fundamental frequency power (f1)fundamental_power = spectrum(idx_f1)^2;% Calculating harmonics (f1, 2*f1, 3*f1, ..., 10*f1)max_harmonic_order = n; % max harmonic orderharmonic_power = zeros(max_harmonic_order, 1); % array to store power of harmonicsharmonic_freq = zeros(max_harmonic_order, 1); % array to store frequency of harmonicsfor k = 1:max_harmonic_orderharmonic_freq(k) = k * f1; % frequency of k-th harmonic% find nearest frequency on the spectrum[~, idx_harmonic] = min(abs(freqs - harmonic_freq(k)));harmonic_power(k) = spectrum(idx_harmonic)^2; % power of k-th harmonicend% power sum of all harmonics exclude first harmonic (fundamental)total_harmonic_power = sum(harmonic_power(2:end));% THD = sqrt(total_harmonic_power) / fundamental_powerTHD = sqrt(total_harmonic_power / fundamental_power);THD_dB = 20 * log10(THD); % THD in dB% calc harmonics power in dBcharmonic_power_dB = 10 * log10(harmonic_power / fundamental_power) +10*log10(2);end

author: langwadt
author_rank: Super Contributor
timestamp: October 25, 2024, 04:48:57 pm
content: Quote from: coppice on October 25, 2024, 02:41:36 pmand you can do all kinds of quirky things, like a in pwm where the output is cnt<val you can reorder some or all of the bits in the counter, of do a D-S with multi bit output and implement the multi bit output as PWM. And you can go differential so i is two 50-50 squarewave and it is the phase between them that set the output.the "advantage" to PWM is lower switching frequency which for higher powers can be important

author: coppice
author_rank: Super Contributor
timestamp: October 25, 2024, 04:59:16 pm
content: Quote from: langwadt on October 25, 2024, 04:48:57 pmOf course. It would be fun to see if something like GaN could get us to going full power sigma-delta.