› Forums › Music › Sound Engineering › Sample rates
- This topic has 31 replies, 8 voices, and was last updated December 11, 2011 at 11:08 am by dubstep_joe.
-
AuthorPosts
-
October 18, 2011 at 5:28 pm #1051703
Just started getting back into mixing and audio, and its dawned on me how much things have changed in only 5-10 years.. :crazy_diz
I’ve got a Tascam DR-05 portable recorder, with various different sample rates.
10 years ago all digital audio for broadcast was standardised at 44.1 kHZ 16 bit by the BBC (and later on other national broadcasters). Hard drive space was damn expensive then.
My source material is currently (unfortunately) mostly 320k MP3s with vinyl transfers being recorded at 44.1K/16 bit (as I think thats the standard of my USB turntable and also the mixing software I am using). This is being fed through an analogue mixer and into the Tascam line in.
At present I am just mixing mostly old skool or euphoric trance from NL rather than producing any music of my own (I just about find time to do the mixing as it is!). I might well move into doing other audio recording for community radio or for stuff at work.
Is there any advantage at all of using a higher sample rate/bit depth for the recordings, or should I just set these to 44.1K 16 bit, and save the hassle of extra time converting stuff later?
This seems like a daft question TBH but bear in mind I am a bit older and am used to stuff like a radio station taking in program audio on a spool of tape at 19 cm/s but recording output at 38 cm/s, or (slightly more modern) playout of news interview from MD but being recorded to a uncompressed sampler…
October 18, 2011 at 8:34 pm #1245707I think if anything’s changed in the last 5-10 years it’s that we’ve seen a general decline in sound quality. Most younger people nowadays don’t even bother to download illegal music anymore (as I did when I was a teenager/student) as it’s all streamed on-demand from sites like Spotify, Grooveshark and Soundcloud, where 128kbps MP3 is usual and 320kbps is considered top quality! Tbh that’s how I listen to most of my music nowadays as it’s just so convenient. 44.1kHz/16bit is a luxury enjoyed only by DJs who pay top dollar for WAVs and the few people who can still be arsed buying CDs.
From a technical point of view there are several advantages of oversampling. I used to know more about it when I had access to all the AES journal papers at university and had to learn this kind of stuff but I’ve mostly forgotten all about it now (I’m using wikipedia to refresh my memory, so this may not be all that accurate). One advantage is that it moves the ‘Nyquist frequency’ well up out of the way and hence removes the need to shove a narrow analogue low-pass filter in the gap between 20k and 22.05k for anti-aliasing (it’s difficult to engineer such a filter in the analogue domain, but very easy once the signal is digitised).
Also, sampling frequency and bit-depth can be ‘traded’ with one-another – sampling at a higher Fs means that a lower bit-depth can be used (i.e. a 24-bit recording can be achieved with a 20-bit sampler and higher Fs). In this case there’s no inherent sonic benefit in using a higher sample rate – it’s just a practical way of achieving greater bit-depth on the cheap.
The bit-depth basically determines the amount of quantisation error (noise) produced when the analogue waveform is sampled (more available bits = more accurate representation of the original signal).
So is it worth you recording at greater than 44.1/16? Possibly not, given that your source material is dance music of dubious quality and your mixes aren’t going to be played on a big club system. You’re also using a fairly cheap recorder that’s not going to have professional-grade ADCs, and in my experience the ADC circuitry can be a much bigger limiting factor than the sample-rate/bit-depth so you might not notice the difference anyway.
On the other hand, based on what I just read on Wikipedia (!!!) it’s possible that using the higher sample-rate modes results in a noticeable change in quality if it physically takes the 20kHz analogue anti-aliasing filter out of the signal path, which might be cheap/poorly implemented in your recorder. I guess the thing to do would be to try it and see, though I suspect you won’t notice much difference.
Anyone else feel free to correct me, I know there are a couple of people on here who know more about this stuff than I do and I’m pretty rusty having not had to think about this since graduating from uni!
October 18, 2011 at 9:12 pm #1245713When DJing it’s down to your own ear really, some people just can’t hear the diferance between 44.1/96,000 etc. and the people who can’t normaly stick with the smaller file size.
With regards to producing a high bit depth is allways good imo as your software synths will create the waveform much more acuratly to begin with and this is essentual if you’re going to be adding effects to it as the lower bit depths have a tendancy to fall apart a little and gain artifacts.
I offten use 32bit float when making tunes and record the final version in the same bit depth (as most daws are totaly rubish at converting the bit rate after) and then resample in soundforge pro 10 (pretty much the best dither algorythem out there) to 24 bit.
With regards to sample rates, it’s best to use what the end recording will be in as all you gain really is extra frequencies above and below what most people can hear. I used to work in 96Khz but recently have been working in either 44.1 or 48 and it’s not hurt the sound of my music noticably.
October 19, 2011 at 1:12 am #1245714Also anything abouve 96Khz is pretty much a gimmick so that people will buy a sound card over another one as people will buy one with 128Khz over one that only does 96Khz.
October 19, 2011 at 8:33 am #1245722Depends what you’re doing to it. if you intend to do any processing (mastering for example) its worth putting things at as high a bit rate as possible regardless of the original quality. If you’re just recording, mixing and putting back onto 16 bit medium you might as well keep it at 16 bit
As for the sample rate I don’t think anyone bothers to go above 44
October 19, 2011 at 9:33 am #1245694Firstly, having grown up in the 1980s and seen at first hand the change from analogue to digital recording I totally agree with what cheesweasel has said about the decline in much broadcast audio content. I was warned about this risk by a number of older engineers when I was in my 20s, including many from the BBC and other major broadcasters.
Even the BBC only use 128K compressed for any dance music programme outside of their studios as most commercial night time venues have at least one ISDN circuit for the purpose of processing credit cards or the data from the tills at the bar. This circuit isn’t always constantly used and often the tills send their data out during the time when the venue is closed. An ISDN circuit still has advantages today as although the BBC has to pay the cost of two telephone calls to the nearest city (not a great amount of money nowadays though) British Telecom guarantee the bandwidth for the duration of that call setup to its clearing, unlike broadband which can flake out at any time.
Much of the quality decline is for political and economic rather than technical reasons – many audio equipment (even cheaper stuff) is far better today than its price equivalent 20 years ago. I used to use a Marantz PMD430 for field recording, which a radio station I worked with had abandoned for minidisc. A relatively bulky device which was carried on the shoulder – in the late 1990s I once managed to scare a bouncer 3 times my size with it who thought I was going for a gun when he asked to search me. To be fair he was not just highly relieved that he wasn’t going to be shot at (there had been a number of firearms incidents linked to the music scene in Reading, ans so I could understand his concerns) but impressed that I’d actually thought to bring in what was then a decent piece of kit to record an event with good quality.
Thankfully I moved to minidisc myself long before 9/11 – completely separate to whatever went on in the USA, there was bad shit brewing up in Blighty even back then due to the dot com crash and some Asian lads were getting into exteremism in my town, funding same by heroin dealing, so Asians in general wre already being viewed suspiciously.
Anyway, ninidiscs were normally an improvement on cassettes but I believe still fairly strongly compressed and if you didn’t do things in the right order you could easily corrupt a entire disc.
Today I was thinking 48Khz 24 bits for recording as I’m not going to have the storage issues or obligations that the BBC have – in common with all other broadcasters, as well as making and storing audio for the usual production purposes, they are legally obliged to securely record all content for Ofcom if/when a complaint is made about a programme so those involved can be brought to judgement, which a little known part of the BBC does just outside Reading in SE England (as well as monitoring foreign broadcasts which is more publicised by Auntie, strange that a “leftie” organisation brags about monitoring Johnny Foreigner but is cagey about its own surveillance ops on its own workers whien such are part of any large (Especially public funded) organisation..)
October 19, 2011 at 10:59 am #1245708@DaftFader 454467 wrote:
With regards to producing a high bit depth is allways good imo as your software synths will create the waveform much more acuratly to begin with and this is essentual if you’re going to be adding effects to it as the lower bit depths have a tendancy to fall apart a little and gain artifacts.
That makes sense actually, I’ve never really thought about the combined effect of all the rounding errors you’d get when you stack tons of plugins on top of a synth.
October 19, 2011 at 1:00 pm #1245695@cheeseweasel 454522 wrote:
That makes sense actually, I’ve never really thought about the combined effect of all the rounding errors you’d get when you stack tons of plugins on top of a synth.
TBH it takes just one slightly over-excited Fillipino lady explaining a difficult issue at work to her boss to overload a VOIP encoder circuit (a low fi-ADC) to the point it starts clipping – then echo cancellers / protection circuitry (to stop ears being blasted) cuts in (bear in mind this is 8000 khz compressed down to 16 kbits per seccond on GSM compression algortithm, as its 8 miles out in bumpkin land where I can’t even spare or guarantee 64K for internal calls) and I get a circuit fault report.
Women talk louder on the phone anyway than men.
Certain accents (many Asian accents, and Scotswomen too) are louder still, and even have frequency bands in their voices what trigger in band signalling. The Post Office got themselves in a bit of a pickle in the early 20th century as they’d invented a otherwise smart piece of kit to share scarce telephone lines between more folk in remote parts of Scotland. it worked fine until the lasses started using the ‘phone and one of them triggered the switching tone and then got her call cleared or worse, switched into to someone elses active circuit!
Even today the ladies sometimes trigger off the DTMF relay on VOIP (used so people dialling call centres can get through the menu). Some folk in public sector agencies mistake this for the intercept tone and get all paranoid as they think we are recording calls to use in complaints later (We don’t have an intercept tone on my systems I build 😉 – that said I’ve never been asked yet to formaly record a call for this purpose, whereas 90% of US companies (even small businesses) set their systems in “big brother mode” and every call goes on hard drive.
I do carry out a lot of lawful intercepts simply to check level/circuit quality, as do most telecoms engineers worldwide, and on occasions they may be requested by their bosses and/or the national authorities (maybe both) to record voice traffic but in the EU you are bound by national and European privacy/data protection laws.
October 19, 2011 at 3:41 pm #1245715@Clusterfrog 454510 wrote:
As for the sample rate I don’t think anyone bothers to go above 44
It depends what medium your music will be listened to on. I.E. CD is 44 standard, but DVD is 48 … so if it’s music for a film you should probably make it in 48 to start with to avoid having to convert it later.
October 19, 2011 at 4:05 pm #1245696@DaftFader 454603 wrote:
It depends what medium your music will be listened to on. I.E. CD is 44 standard, but DVD is 48 … so if it’s music for a film you should probably make it in 48 to start with to avoid having to convert it later.
And off miniDV as well, (hadn’t realised this until today when i checked out a captured camera file) although 16 bits PCM.
As I might add footage to other stuff I will record at 48 Khz then. I wonder if the Tascam recorder will hold sync for recording audio for live video? Shocking though how much a decent clapperboard costs (the novelty ones aren’t much good, the sound isn’t sharp enough).
Video
ID : 0
Format : DV
Format_Commercial_IfAny : DVCPRO
Codec ID : dvsd
Codec ID/Hint : Sony
Duration : 10s 760ms
Bit rate mode : Constant
Bit rate : 24.4 Mbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Compression mode : Lossy
Bits/(Pixel*Frame) : 2.357
Stream size : 36.9 MiB (95%)
Encoding settings : ae mode=full automatic / wb mode=automatic / white balance= / fcm=manual focusAudio
ID : 1
Format : PCM
Format settings, Endianness : Little
Format settings, Sign : Signed
Codec ID : 1
Duration : 10s 760ms
Bit rate mode : Constant
Bit rate : 1 536 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Stream size : 1.97 MiB (5%)
Interleave, duration : 399 ms (9.96 video frames)October 19, 2011 at 4:09 pm #1245709@Clusterfrog 454510 wrote:
Depends what you’re doing to it. if you intend to do any processing (mastering for example) its worth putting things at as high a bit rate as possible regardless of the original quality. If you’re just recording, mixing and putting back onto 16 bit medium you might as well keep it at 16 bit
As for the sample rate I don’t think anyone bothers to go above 44
I think GL just wants to record some DJ mixes off his computer and wants to know if it’s really worth the hassle of using the oversampling/high bit-rate modes on the recorder when it will produce files that most media players won’t recognise anyway (whatever happens, the files will likely end up being converted to 44.1/16 wav or MP3 anyway). I.e. are there enough pros to outweigh the cons of having to convert the files.
44.1kHz is CD standard. 48kHz has been the ‘professional’ DAT standard for the last couple of decades. Oversampling at 96kHZ or higher (often using very expensive ADCs) is commonly used by recording engineers, particularly in the classical world, to get the best possible sound down ‘at source’, due to the benefits of oversampling which I tried to explain in a slightly half-arsed way earlier.
October 20, 2011 at 7:37 pm #1245705We tend to use cd audio quality for most recordings of mixes as they tend to end up burned to cd at some point and it saves time. We also record in a program which uses a much higher sample rate should we want it [up to 64 bit] – we do use it sometimes if we are making a master of a tune and then use the big file to produce the normal cd audio ones from after mastering.
When tunes are being made they are recorded as wavs never mp3s as we can rip them to mp3s later if we want and it means they sound nicer; once the music has been mp3’d the stuff which is gone wont be coming back and we have the rig in the house fulltime atm so we can hear how crap the mp3s sound compared to the wavs.
What you are doing with the audio is important – as is what you listen to it on [a full frequency response active rig is much less forgiving than a tinny set of ipod speakers]. Try the various formats and sampling rates over what you are planning to listen to it on and see how you like it.
Be aware that sound engineering these days is dire for the most part and the louder is better school of thought means that a lot of mp3s have digital distortion encoded into them from being overdriven. You may not be able to hear it [95% of the population cant apparently] but it will make you irritable and twitchy even so.
A lot of tv programs these days have that kind of distortion encoded into them and I have watched a room full of happy folk get grumpy very fast when that digital distortion is present while none of them could actually hear it clearly. This works for cats and dogs too btw – our cats and dogs will get up and leave the room if the sound is overdriven in any way so the sign of good music is the presence of the keen furry audience in front of the sound source and I always take note if they have all cleared out as its unusual to have no furry animals present when music is being played….
October 26, 2011 at 8:37 am #1245697@Raj 454766 wrote:
Be aware that sound engineering these days is dire for the most part and the louder is better school of thought means that a lot of mp3s have digital distortion encoded into them from being overdriven. You may not be able to hear it [95% of the population cant apparently] but it will make you irritable and twitchy even so. [/quote]
this could be the quality of the MP3 conversion but there’s a few tunes I’ve rejected now I’ve got decent kit to listen to them on – and even the Dutch trance has had much of the dynamic range compressed out of it (this may be due to the MP3 encoding though, any ideas where to get better quality audio from?) Geen probleem voor mij, als het paginas / online-winkelen in Nederlands zijn 😉
A lot of tv programs these days have that kind of distortion encoded into them and I have watched a room full of happy folk get grumpy very fast when that digital distortion is present while none of them could actually hear it clearly.
they definitely shove a compresor into the ads to make them louder, I’ve seen the control system programming to do this when i was working in the industry 10 years ago.. it doesn’t surprise me though that the program audio for telly is distorted as there are a lot of consumer camcorders being used and camera ops who don’t know how to or don’t have the time to correctly set audio level..
Quote:This works for cats and dogs too btw – our cats and dogs will get up and leave the room if the sound is overdriven in any way so the sign of good music is the presence of the keen furry audience in front of the sound source and I always take note if they have all cleared out as its unusual to have no furry animals present when music is being played….HF distortion would be most unpleasant to these creatures (and is used in some pest control systems)!
There’s a true story about a cat in the 1970s who used to sleep on top of his owners telly (in the days of the BRC telly which was the equivalent of a British Leyland idiot-box and about as reliable as BL motor cars).
One evening the cat sudddenly awoke and bolted out of the room – his owner was so surprised by this he went to follow it. As he went out of the room, the telly burst into flames and imploded its CRT spraying glass shards everywhere… (these sets were prone to do this from a failure of the line output stage, but the cat must have heard the high frequency noise it makes changing and fluctuating…)
October 26, 2011 at 10:20 pm #1245706The trance compression has been around for a while now – we have some records with it on and its pure nasty to listen to. Same applies to the chemical brothers although probably to a lesser extent. The loss of dynamic range is irritating when you are listening to something which has had the crap compressed out of it – I always wonder how much better it would have sounded uncompressed.
To my mind compressors are a notoriously over used and under comprehended piece of equipment – have come across so many of them incorrectly set up in my time that its probably in the thousands now and when cross examining the people who have set them up its painfully clear that if they did RTFM they certainly didnt understand what it said in it…..
October 28, 2011 at 12:44 pm #1245698a true story from a New Zealand Hi-fi magazine – in their country (like most Pacific nations) they have a verandah and semi-covered outbuilding which people sit in when weather permits. This chap always had a hi-fi system there which he listened to classical music on, but decided to upgrade a cheap Taiwan midi system to some vintage British equipment he managed to obtain second hand – I think it was a Garrard SP25 turntable, a Leak or similar amp and Celestion loudspeakers.
He set it up and started listening, then became aware of scuffling noises above his head. When he looked up, a entire family of roof/black rats (rattus rattus) had appeared and were all perched on a beam of wood, intently listening to the loudspeakers! Of course the rats (this species is numerous in Pacific areas) were always there, but they had not taken much notice of the cheaper hi-fi.
The chap decided as they appreciated good hi fi and weren’t gnawing up cables, he would let them stay, they had too good taste to be viewed as vermin..
Rattus Rattus. it is more “mouse like” than the Norway rat found in Europe, and mice are known for appreciating music)
October 29, 2011 at 7:43 am #1245700:laugh_at:First we gave you trolls then rattus norvegicus
October 29, 2011 at 11:41 am #1245699Apparently that ones Asian as well or from the Middle East, though Norway’s maritime links would have brought a few rodents along with the ships. However it thrives better in colder areas than rattus rattus (today if you saw one in the UK the Zoo would be more likely to capture it and keep it in the small mammals area!).
Even Novartis pest control website describes it as “sleek and good looking”
Its less musically appreciative than the mouse or black rat – apparently you can din a Norway rat out of its nest by playing loud music at it…
I was going to live trap one at work because it was gnawing telephone cables, and I’d rather do this than trust the old ratcatcher scattering difenacoum everywhere without PPE – the old boy’s been in hospital 4 times already with mild strokes and bust his ankle tripping down a rabbit hole :yakk: – but you need more than one trap due to the social groups of rats and at £15 a time they aren’t cheap.
I was then going to fix the cage to my bike with bungee ropes, cover it so the rat doesn’t get frightened and then ride to Stowmarket, where I would have photographed and released it.
Now I keep a clipboard in my panniers for making notes about stuff at work, and had I been challenged by the local yokels I would just have said – “I’m a contractor for Mid Suffolk District Council – I am making sure you’ve all got sufficient rats to see you through the winter in accordance with new EU wildlife regulations. Could you please sign here for this one?”
November 19, 2011 at 10:07 pm #1245710@Raj 454766 wrote:
This works for cats and dogs too btw – our cats and dogs will get up and leave the room if the sound is overdriven in any way so the sign of good music is the presence of the keen furry audience in front of the sound source and I always take note if they have all cleared out as its unusual to have no furry animals present when music is being played….
I’ve often wondered what an MP3 would sound like to a dog or cat (in fact I remember asking this question in a lecture once and people thought I was taking the piss), as the way MP3 works is by exploiting redundancy in the human auditory system by using the masking effect. This requires a virtual model of the human ear to be incorporated into the encoder, which tells it which frequencies will be masked by the programme material (these frequencies are then re-sampled at a much lower bit-depth but the resulting quantising noise is masked). To a non-human listener it must sound like total junk.
November 20, 2011 at 6:55 am #1245701@cheeseweasel 458272 wrote:
I’ve often wondered what an MP3 would sound like to a dog or cat (in fact I remember asking this question in a lecture once and people thought I was taking the piss), as the way MP3 works is by exploiting redundancy in the human auditory system by using the masking effect. This requires a virtual model of the human ear to be incorporated into the encoder, which tells it which frequencies will be masked by the programme material (these frequencies are then re-sampled at a much lower bit-depth but the resulting quantising noise is masked). To a non-human listener it must sound like total junk.
Aye – I would imagine they sound pretty horrible (if you play them on a half decent size and quality rig that so called redundancy in the human auditory system becomes immediately obvious to most people)… They don’t encode anything over 16KHz (the last band of the 32 bank PQF only goes up to 16KHz as the “average” persons hearing doesn’t usually hear much over that). Cats, dogs and the rats mentioned probably hear well into the middle 20-30KHz range and maybe even further, so to them it’s missing a lot of it’s audio information – even a CD likely sounds stunted to them (which would explain why our cats always seem to prefer analogue sources to digital ones)…
The masking effect (specifically the limits thereof) where the theory says lower amplitude sounds are masked by higher amplitude to the point that the lower are not in fact heard at all if the difference is large was brought home to me pretty forcefully with the new Orb album recently. When I first got it, it was a 192Kbps mp3 version which I listened to for a while before eventually going out and getting a cd version. When I got the cd I was fairly shocked at the difference – the latest album by the Orb has very much gone back to their original sound where the sound is layered and extremely complex, built up over the course of the song, and in many ways felt as much as physically heard – the mp3 had stripped so much of that out that it was almost like listening to 2 totally different albums…
@General Lighting 454438 wrote:
My source material is currently (unfortunately) mostly 320k MP3s with vinyl transfers being recorded at 44.1K/16 bit (as I think thats the standard of my USB turntable and also the mixing software I am using). This is being fed through an analogue mixer and into the Tascam line in.
The mp3’s are a waste of time recording over 44.1, due to the above mentioned upper cap on the highest frequency. Even when mp3’s are recorded with a 48K rate, the compression algorithm essentially removes most of the benefit of the higher frequency by focussing on the theoretical human audible response – essentially the fletcher/munson curve of between 2 and 5KHz and stripping out much of the data at the extremes in order to do this (even a 320Kbps mp3 is running at less than 1/2 the bandwidth required for 44.1KHz and 16bit – increase the frequency and more has to be stripped out – ditto the bit rate. Some of that compression is done losslessly, but not that much)…
The vinyl is a different matter, and would benefit from as high a rate as you can get away with – I tend to like recording at 96KHz and 24bit if I can, as the resulting recording sounds far better at that rate (and even taking into account the need to dither for changing bit depth, and anti aliasing for the sample rate change, the resample to cd quality still usually comes out with an acceptable sound)…
As for the DV, sony stuff tends to use their proprietary codec for the audio – either the pca lossless one, or the lossy one that I cannae remember the name of off hand… They are both (though it pains me to say anything good of the evil empire :cry:) pretty good quality, but are going to need downsampling (and therefore anti aliasing) to put on a cd (and will sound better at the 48KHz original rate if you can use it)….
November 20, 2011 at 2:23 pm #1245723I’m curious guys. Does anyone know how a sound waveform is encoded? What does the ’rounding’ error relate to? Is the ‘amplitude’ being stored as a 16/24/32 bit integer? Would a bigger bit-size just mean one can encode ‘louder/bigger’ amplitudes?
Does anyone understand the principle behind ‘The Nyquist–Shannon sampling theorem states that perfect reconstruction of a signal is possible when the sampling frequency is greater than twice the maximum frequency of the signal being sampled’?
😀 much love to the vibrational frequency 😀
November 20, 2011 at 5:15 pm #1245711Noname wrote a really excellent guide to audio fundamentals a while ago. It explains all of those things:
http://www.partyvibe.com/forums/sound-engineering/27792-how-build-sound-system.html
November 20, 2011 at 7:34 pm #1245716@dubstep_joe 458290 wrote:
I’m curious guys. Does anyone know how a sound waveform is encoded? What does the ’rounding’ error relate to? Is the ‘amplitude’ being stored as a 16/24/32 bit integer? Would a bigger bit-size just mean one can encode ‘louder/bigger’ amplitudes?
Does anyone understand the principle behind ‘The Nyquist–Shannon sampling theorem states that perfect reconstruction of a signal is possible when the sampling frequency is greater than twice the maximum frequency of the signal being sampled’?
😀 much love to the vibrational frequency 😀
Rounding errors happen when a analog wave is stored in digital format, analog is an exact waveform … where digital is a 1/0 … because of this you’ll never have a perfect reprisentation of the analog wave. The higher the bit rate the more acurate the digital representation of the analoug wave is.
[ATTACH=CONFIG]81017[/ATTACH]
That’s a picture of an analoug wave and a very low res digital wave
[ATTACH=CONFIG]81018[/ATTACH]
And that’s one of how they would overlay (to make the explination more easily understood).As you can see the digital wave is just staight lines where analog is curved, the rounding errors happen when you try and turn a curved analog wave into a digital one or visa versa as it has to “work out” where the wave it’s turning into should actualy be as the input wave will not be in the same place.
It’s like in any maths … if something doesn’t fit 100% there’s a remainder left over and the algorythem has to round up or down for the conversion to work properly. These rounding errors cause artifacts in the sound. The higher the bit rate the more straight lines per sample are in the digital reprisentation of the analog wave there for making the size of the rounding errors smaller and the more acuratly the sound is reprisented.
[ATTACH=CONFIG]81019[/ATTACH]
(I might of ment bit depth not bit rate … )
November 20, 2011 at 7:54 pm #1245717nyquist Is a formula that tells you how to get the best reprisentation possible by making the sample rate twice as big as the differance between the lower and upper most frequency you want to use. (At least that’s how I understand it … I’ve not 100% got to grips with nyquist my self). It’s got other uses as well and is in alot of other formula’s used when working with sound reprisented as “n”..
November 20, 2011 at 8:38 pm #1245712The Nyquist frequency is pretty easy to understand once you’ve seen a diagram of it.
It states that the sampling frequency must be twice the highest frequency in the audio you want to sample. The Nyquist frequency represents the maximum audio frequency that can be sampled, and is simply the sample-rate divided by two. E.g. the reason why CD has a sample-rate of 44.1kHz is that the Nyquist frequency is (44.1k)/2 = 22.05k, allowing the full human frequency spectrum (20Hz-20kHz) to be sampled.
You can see that when the frequency of the audio waveform (the blue waveform on the graph) is more than half the sampling frequency (the red dots on the graph) the signal is incorrectly captured. This results in an ‘alias’ component (the red waveform on the graph) which is a reflection of the correct frequency around the Nyquist frequency (think of it like a mirror). E.g. if you tried to sample a 14kHz sine wave using a sample-rate of 20kHz you would get an alias component at 6kHz (10k minus 4k).
Because of this aliasing effect it’s important not to allow any frequencies above the Nyquist limit to enter the sampler, so the first stage in any analogue-to-digital converter (ADC) is an analogue low-pass filter. All filters have a slope around their cutoff frequency, so a bit of extra bandwidth is required to accommodate it (this is why CDs are sampled at 44.1kHz instead of 40kHz as you might expect).
November 21, 2011 at 12:34 pm #1245702Aye – pretty much what cheeseweasel and Daftfader said. When I talked about having to use anti aliasing when you downsample – ie from 48K to 44.1K or such it is for the reason explained above (anti aliasing attempts to remove any aliasing errors by filtering everything above the Nyquist limit) Another process called interpolation is used to make the waveform more closely follow the higher rate waveform by altering the placing of some sample points in this manner:
[ATTACH=CONFIG]81023[/ATTACH]
Not 100% sure, but I believe this is still covered in the Nyquist theorem, although it’s called Shannon-Whittaker interpolation after some of the other folk who are responsible for the theory (that only Nyquist seems to generally get his name on for some reason)… Much of the original mathematical proofs are written by Claude Shannon, and Whittaker came up with the same idea independently of them.
Anyways to explain the diagram:
The absolute path for a halfed sample rate (the dotted red line) is much less dynamic than the original at the higher rate – therefore we move some points (the green line) to more faithfully represent the source (obviously it isn’t perfect, but the green line is markedly more dynamic than the dotted red where the signal fails to get out of negative Voltages for 6 samples in the middle – the original does so 3 times during the same period, and the green manages it twice).
Thats a very basic explanation of the theory. The actual process of anti aliasing and downsampling usually involves running a low pass filter to filter out any frequency changes that are above the Nyquist limit (in the same way as converting from analogue to digital – although a band pass is sometimes used in AD conversion because the analogue source is continuous and band pass can help avoid some quantisation errors. Downsampling can’t use a band pass filter, and must use low pass (AFAIK – I could be wrong here though – there are bits of Nyquist that are just too much maths for my brain to cope with…)
Then I believe some form of inverse Fourier is used to try and rebuild the original source as far as possible, and this is then quantised back to the digital waveform required (this could be complete nonsense though – as I say, maths makes my head melt – especially when greek letters and such are involved :crazy:)
As for bit depth, it dictates the resolution of the representation – 8 bit gives 512 levels of resolution, 16 bit 65,536, and 24 bit 16,700,000 or so. This dictates the dynamic range (the difference between the smallest and largest sound representable), and as a consequence of that it also dictates the signal-noise ratio. When audio is quantised (the process of squaring the waveform – necessary because it’s being represented by a series of discrete points instead of a continuous wave as it is as an analogue signal), it introduces repeated quantisation errors (which manifest as harmonic distortion at the 1st and subsequent harmonic frequencies – not generally very nice sounding – think someone planking a flat palm on a piano keyboard and hitting 6 or 7 keys together). So the process of “dithering” tends to be used (where the repeated errors in the quantisation function are randomised so removing the build up around the harmonics).
dubstep_joe wrote:I’m curious guys. Does anyone know how a sound waveform is encoded? What does the ’rounding’ error relate to? Is the ‘amplitude’ being stored as a 16/24/32 bit integer? Would a bigger bit-size just mean one can encode ‘louder/bigger’ amplitudes?Rounding error is the afore mentioned quantisation problem.
In PCM (which is what is generally used to encode a wave), the audio is encoded with a set rate (the sampling frequency), and a measurement of the amplitude is taken. This is then quantised into a digital representation (a process otherwise known as modulation).To reconstruct the audio it must be demodulated (using Nyquist/Shannon’s method of reconstructing the original wave, and passing it through some filters to remove the unwanted additions introduced as an unavoidable side effect). This produces a voltage (or current sometimes – depends on the DAC) which is then used as the original analogue electrical source would have been.
The amplitude is stored as a (probably integer) value usually (although from the POV of information, floating point values can represent the same quantity of info and therefore the same resolution). Don’t get confused between the actual physical property of the wave encoded, and our representation of it using numbers – louder is a physical property, whereas the amplitude stored in the numbers is a representation of it (the bit depth allows us to represent it more accurately, and also allows us to change the original, including the amplitude if we have sufficient resolution and the original signal has enough headroom – the “normalise” function in audio progs does this as a way to maximise the dynamic range by increasing the amplitude of the loudest part to 0dB (or the highest amplitude encodable), and changing the other amplitudes by the same amount through the whole wave).
It wouldn’t matter if we had 1 as the highest amplitude – 24 bit would still break the range 0-1 into 16,700,000 discrete values, and similarly if we had 512 as the highest, 8 bit would still only encode 512 discrete values (and in the previous example for 0-1, 8 bit would have 512 values between 0 and 1…) I would imagine most systems use integers (possibly with a single bit for positive and negative designation so the standard representation of a wave oscillating around the 0 point can be imagined easily), because computers are historically better with integers than they are with floating point maths (way back when, before the PC had developed the math co-processor to handle floating point calculations, PC’s were lamentably slow at anything involving floating points…)
Hope that all makes some sort of sense – gonna stop now cos it got a lot longer than I planned it to be… :sign0020:raaa:lol_crash
-
AuthorPosts
- You must be logged in to reply to this topic.
› Forums › Music › Sound Engineering › Sample rates