AudioMasters
 
  User Info & Key Stats   
Welcome, Guest. Please login or register.

Login with username, password and session length
December 16, 2007, 03:22:58 PM
62675 Posts in 6217 Topics by 2169 Members
Latest Member: tone2
News:   | Forum Rules
+  AudioMasters
|-+  Audio Related
| |-+  General Audio
| | |-+  why does this square wave sound cleaner when downsampled?
  « previous next »
Pages: [1] 2 3 Print
Author
Topic: why does this square wave sound cleaner when downsampled?  (Read 3290 times)
« on: June 02, 2004, 02:59:23 PM »

Guest

I was experimenting with square waves in CEP2 and what I found out is that the square wave that I generated (3khz) sounded better on my cd player when it was first generated in 96khz then downsampled to 44.1khz, same goes for 48khz.

So 96khz was first, 48khz second and 44.1khz last and terrible may I add.
Why is this so?

Does this all relate to why we need to record in 96khz and higher.
Logged
Reply #1
« on: June 02, 2004, 03:33:41 PM »
zemlin Offline
Member
*****
Posts: 2762

WWW

Is downsampling/dithering rounding the corners of the waveform?
Logged

Reply #2
« on: June 02, 2004, 03:50:25 PM »
Graeme Offline
Administrator
Member
*****
Posts: 1815

WWW

Quote from: tannoyingteflon
Does this all relate to why we need to record in 96khz and higher.


Don't include me in that "we" - I don't think it's at all necessary to record at such high sampling rates.
Logged

Reply #3
« on: June 02, 2004, 08:12:37 PM »
VoodooRadio Offline
Member
*****
Posts: 1621



Quote
Graeme Posted:
--------------------------------------------------------------------------------
 Don't include me in that "we" - I don't think it's at all necessary to record at such high sampling rates.
Same here.... FWIW, I don't bother with anything over 44,100.  If you accomplish the task of tracking a good sounding, clean signal with good kit, then (personally) I can't see any benefit.

 wink
Logged

Good Luck!

VooDoo
Reply #4
« on: June 02, 2004, 08:22:39 PM »
Bobbsy Offline
Member
*****
Posts: 424



Er...what qualifies as "better" when listening to something as artificial as a square wave?  I suspect the previous guess about the corners being rounded in the downsampling could be what you're hearing...but in fact you're getting a less accurate wave out of it!

Bob
Logged

Good sound is the absence of bad sound.
Reply #5
« on: June 02, 2004, 09:04:12 PM »
groucho Offline
Member
*****
Posts: 1412



Mmm... dude... dig the sound of that square wav....

I don't know about you but I can't even stand to listen to a square wav these days unless it's been downsampled from 96khz.

Of course square wavs really sound the best on vinyl...

Chris wink
Logged
Reply #6
« on: June 02, 2004, 09:22:55 PM »
binarystudios Offline
Member
*****
Posts: 812

WWW

Speaking of Vinyl. I need a record player. I have a ton of 7 inches and LPs but no player.  cry
Logged

Reply #7
« on: June 02, 2004, 09:23:05 PM »
zemlin Offline
Member
*****
Posts: 2762

WWW

Logged

Reply #8
« on: June 02, 2004, 09:50:51 PM »
VoodooRadio Offline
Member
*****
Posts: 1621



Are we saying that we're "hip", Karl?

 shocked
Logged

Good Luck!

VooDoo
Reply #9
« on: June 02, 2004, 11:03:28 PM »
Mac Offline
Member
*****
Posts: 1191

WWW

To all the nay-sayers, did you actually check this out?  Teflon appears to be right, a 3khz square definately sounds better when downsampled from 96khz!


Don't believe me, here is the 96khz downsampled:


and here is the straight to 44khz one:



While in sample view, the 44khz version appears more sample-accurate, but the 96khz version has the frequency spectrum I think is correct (odd-n harmonics, with none of the strange background harmonics).  

It seems that even a 300hz square has a messed up spectrum in 44khz, as I thought this may be a problem of there only being a handful of samples per cycle.  Also I can't seem to produce a reliable 1khz square in 96khz, it has clicks throughout huh

What's going on here? Cheesy
Logged

(|-_-|)
Reply #10
« on: June 02, 2004, 11:12:30 PM »
Mac Offline
Member
*****
Posts: 1191

WWW

About the corner rounding...  downsampling does more than that, it mutilates the whole waveform - but rather than smoothly rounding it (which would admittedly sound more pleasing) it makes the waveform follow the 'wibbly' path that the line joining the dots wants to follow one a sample-accurate wave - if you follow my poor explanation.

Logged

(|-_-|)
Reply #11
« on: June 03, 2004, 01:51:53 AM »
zemlin Offline
Member
*****
Posts: 2762

WWW

Back at home (work is a DAW-Free zone) and did a little investigation myself.

Have a gander at this one (300 Hz):


The green plot is the straight 44KHz.  Red is the downsampled version.  Increasing the FFT size changes the downsampled plot some.

A Square wave is the sum of the fundamental sine + each subsequent harmonic.  It is interesting that downsampled file has only the odd-numbered harmonics.  Also the -84db minimum on the 44 KHz version compared to the -150 dB or so on the downsampled file.

You can't overlay freq plots of 44KHz and 96 KHz plots accurately (bug or future enhancement request?) but the unaltered 96 KHz freq plot is only slightly different than the downsampled one shown here, and also includes only the odd-numbered harmonics.

Hmmmm.
Logged

Reply #12
« on: June 03, 2004, 03:07:17 AM »
DeluXMan Offline
Member
*****
Posts: 910



I just got here and the topic is interesting... but remember that a perfect square-wave has only odd harmonics, and a ramp or sawtooth has both odd and even harmonics.   Cool  The better you represent a square-wave the fewer even harmonics will be present.

Mac: The perfect square-wave you generated has odd harmonics up to infinity.  The squiggly lines are what the square-wave looks like without it's harmonics above 96kHz. or 48kHz. or 24kHz. - say for 96kHz. - all harmonics above 48kHz. will be gone, so the straight lines become squiggly, reveiling the summed sine-wave nature of wave-forms.   Cool  

The displays you posted show a slower slew rate or transition slope for the 44.1kHz. example that smears the screen, true, but this again simply  represents a square-wave with all harmonics above 22.050kHz. removed.  We could do the same excersise at 192kHz. and at 384kHz. and see the very same thing - it's a matter of scale.

Teflon: What does a better square-wave sound like.  What was better about it for you when you compared the two?
Logged

=DeluX-Man=
Reply #13
« on: June 03, 2004, 03:46:20 AM »
zemlin Offline
Member
*****
Posts: 2762

WWW

Quote from: tannoyingteflon
... sounded better on my cd player ...
which could also be saying something about the converters on your CD player.  No question that the downsampled waveform is distorted - but to be honest, I couldn't hear a difference in headphones.

Quote from: DeluXMan
remember that a perfect square-wave has only odd harmonics

So it does ... still makes me go Hmmm, just looking the other direction.  Why are they there in the 44KHz signal?  The samples don't show any lack of squareness even when zoomed WAYYY up.
Logged

Reply #14
« on: June 03, 2004, 04:24:42 AM »
DeluXMan Offline
Member
*****
Posts: 910



I'm not getting any even harmonics on my generated square-waves which is as expected, even when i convert a 96kHz. to a 48kHz. or start with 48kHz. and convert up to 96kHz.  Maybe you have a bug Zemlin - try a different frequency maybe.  Cool
Logged

=DeluX-Man=
Pages: [1] 2 3 Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS! Ig-Oh Theme by koni.