Sampling rate and latency

Author
Sixfinger
Max Output Level: -73 dBFS
  • Total Posts : 890
  • Joined: 2007/09/22 07:55:26
  • Location: Branson MO
  • Status: offline
2012/10/17 13:14:03 (permalink)

Sampling rate and latency

I've seen it stated a few times that higher sampling rate settings in Sonar will yield lower latency.
 
Anyone care to explain why this is?

Sonar Platinum , ADK Computer -Intel - Penryn Quad Core Q9400 Processor, Windows 7 Home premium 64, RME Fireface UFX, Grace 101 Pre's, A-800 Pro, assorted mics, Strats ,Les Pauls, Mesa Boogies
http://lionfeather.com
#1

9 Replies Related Threads

    robert_e_bone
    Moderator
    • Total Posts : 8968
    • Joined: 2007/12/26 22:09:28
    • Location: Palatine, IL
    • Status: offline
    Re:Sampling rate and latency 2012/10/17 14:03:01 (permalink)
    I believe that mathematically you take the sample buffer size and divide it by the sample rate to give you the latency, so that:

    512 sample buffer size at 44.1 khz sample rate gives you 11.6 (rounded) ms latency

    512 sample buffer size at 96 khz sample rate gives you 5.3 ms latency

    It of course comes at a price, that being curb-stomping your CPU at higher sampling rates.

    I have a crazy fast CPU and 43 GB of memory, with what I believe is a reasonable audio interface (specs are below), and I still record at 44.1 because I don't want things pushed to the edge where it is a constant worry.

    I suppose I will spend some more time tweaking things - but if there is not that much gain to it, I will probably not do too much.  For example, I found that I could trim off about 2 ms in total round trip latency by turning off all kinds of services and disabling my antivirus software and all of that, but that just didn't float my boat for having to lose internet capability during audio processing, so I undid it.

    Remember too, that it is the Total Round Trip Latency that is ultimately sets the quality of sound output - that initial calculation is only a piece of that.

    Bob Bone


    Wisdom is a giant accumulation of "DOH!"
     
    Sonar: Platinum (x64), X3 (x64) 
    Audio Interfaces: AudioBox 1818VSL, Steinberg UR-22
    Computers: 1) i7-2600 k, 32 GB RAM, Windows 8.1 Pro x64 & 2) AMD A-10 7850 32 GB RAM Windows 10 Pro x64
    Soft Synths: NI Komplete 8 Ultimate, Arturia V Collection, many others
    MIDI Controllers: M-Audio Axiom Pro 61, Keystation 88es
    Settings: 24-Bit, Sample Rate 48k, ASIO Buffer Size 128, Total Round Trip Latency 9.7 ms  
    #2
    Bigdogs
    Max Output Level: -83 dBFS
    • Total Posts : 378
    • Joined: 2010/01/10 13:16:23
    • Location: Reading, UK
    • Status: offline
    Re:Sampling rate and latency 2012/10/17 14:03:02 (permalink)
    I think that this is due to the fact that latency is in part defined by the size of buffers in use. So, if you have a buffer size of 512 samples, a higher sample rate means this buffer stores a shorter length of audio. 

    Sonar Platinum 64 bit, Windows 10 64 bit, i5 4670K Haswell Processor,  4.2GHz, 8Gb RAM, Focusrite Scarlett 2i4, AMD Radeon R7 260X, 120GB Samsung 840 EVO SSD, 1000GB 7200RPM Hard Disk     
    #3
    robert_e_bone
    Moderator
    • Total Posts : 8968
    • Joined: 2007/12/26 22:09:28
    • Location: Palatine, IL
    • Status: offline
    Re:Sampling rate and latency 2012/10/17 14:16:19 (permalink)
    I withdraw my math - as I was typing it I realized that if that were the case then mathematically speaking if I cut the sample buffer size to 256 and the sample rate to 44.1 it should end up somewhere around the same as the 512 at 96.

    So I am back to I don't know either.

    Sorry if I expended anyone's neuron firings for no reason, 

    Bob Bone

    Wisdom is a giant accumulation of "DOH!"
     
    Sonar: Platinum (x64), X3 (x64) 
    Audio Interfaces: AudioBox 1818VSL, Steinberg UR-22
    Computers: 1) i7-2600 k, 32 GB RAM, Windows 8.1 Pro x64 & 2) AMD A-10 7850 32 GB RAM Windows 10 Pro x64
    Soft Synths: NI Komplete 8 Ultimate, Arturia V Collection, many others
    MIDI Controllers: M-Audio Axiom Pro 61, Keystation 88es
    Settings: 24-Bit, Sample Rate 48k, ASIO Buffer Size 128, Total Round Trip Latency 9.7 ms  
    #4
    CJaysMusic
    Max Output Level: 0 dBFS
    • Total Posts : 30423
    • Joined: 2006/10/28 01:51:41
    • Location: Miami - Fort Lauderdale - Davie
    • Status: offline
    Re:Sampling rate and latency 2012/10/17 14:31:35 (permalink)
    Its because of the circumference of the higher rate equals the radius of the buffer squared. So if you take A minus B and divide that by the higher rate and then round that to the nearest point in a linear field, you'll see that its non contextual. 

    That is why you have lower latency with higher sample rates

    www.audio-mastering-mixing.com - A Professional Worldwide Audio Mixing & Mastering Studio, Providing Online And Attended Sessions. We also do TV commercials, Radio spots & spoken word books
    Audio Blog
    #5
    robert_e_bone
    Moderator
    • Total Posts : 8968
    • Joined: 2007/12/26 22:09:28
    • Location: Palatine, IL
    • Status: offline
    Re:Sampling rate and latency 2012/10/17 14:51:03 (permalink)
    Was that Latin?

    WOW - now I REALLY withdraw my math - I am glad I am just a keyboard player and blissfully ignorant of what I really should know about all of this.

    You sir, have just exponentially raised my already deep appreciation for what sound guys give to this planet.

    Thanks, 

    Bob Bone

    Wisdom is a giant accumulation of "DOH!"
     
    Sonar: Platinum (x64), X3 (x64) 
    Audio Interfaces: AudioBox 1818VSL, Steinberg UR-22
    Computers: 1) i7-2600 k, 32 GB RAM, Windows 8.1 Pro x64 & 2) AMD A-10 7850 32 GB RAM Windows 10 Pro x64
    Soft Synths: NI Komplete 8 Ultimate, Arturia V Collection, many others
    MIDI Controllers: M-Audio Axiom Pro 61, Keystation 88es
    Settings: 24-Bit, Sample Rate 48k, ASIO Buffer Size 128, Total Round Trip Latency 9.7 ms  
    #6
    gswitz
    Max Output Level: -18.5 dBFS
    • Total Posts : 5694
    • Joined: 2007/06/16 07:17:14
    • Location: Richmond Virginia USA
    • Status: offline
    Re:Sampling rate and latency 2012/10/17 15:35:37 (permalink)
    just bc 512 samples pass during different time durations at different rates doesnt mean your pc handles more work in less time. as a matter of fact, as the queue approaches capacity, latency goes up very fast. see queueing theory. this is a good reason to stay ay lower rates and set buffer appropriately.
    #7
    gswitz
    Max Output Level: -18.5 dBFS
    • Total Posts : 5694
    • Joined: 2007/06/16 07:17:14
    • Location: Richmond Virginia USA
    • Status: offline
    Re:Sampling rate and latency 2012/10/17 15:41:15 (permalink)
    ffor a real world test, notice processor work under 44.1, then 88.2 with th2 on the track. you should notice processor load more than double.
    #8
    robert_e_bone
    Moderator
    • Total Posts : 8968
    • Joined: 2007/12/26 22:09:28
    • Location: Palatine, IL
    • Status: offline
    Re:Sampling rate and latency 2012/10/17 15:57:46 (permalink)
    Thanks - on my system it seems to work OK at 128 sample buffer size and 44.1 - my interface has an additional setting Fastest/Normal/Safe, and I run on Normal.

    If I disable a bunch of services and all that I can change that one setting to Fastest, and it gives me about 2 ms lower latency, but then I don't have any Internet access and all of that, so I don't bother - I just leave it on Normal, whatever that is telling it to do.

    Bob Bone

    Wisdom is a giant accumulation of "DOH!"
     
    Sonar: Platinum (x64), X3 (x64) 
    Audio Interfaces: AudioBox 1818VSL, Steinberg UR-22
    Computers: 1) i7-2600 k, 32 GB RAM, Windows 8.1 Pro x64 & 2) AMD A-10 7850 32 GB RAM Windows 10 Pro x64
    Soft Synths: NI Komplete 8 Ultimate, Arturia V Collection, many others
    MIDI Controllers: M-Audio Axiom Pro 61, Keystation 88es
    Settings: 24-Bit, Sample Rate 48k, ASIO Buffer Size 128, Total Round Trip Latency 9.7 ms  
    #9
    Bristol_Jonesey
    Max Output Level: 0 dBFS
    • Total Posts : 16775
    • Joined: 2007/10/08 15:41:17
    • Location: Bristol, UK
    • Status: offline
    Re:Sampling rate and latency 2012/10/18 05:49:27 (permalink)
    One benefit of using higher sample rates is that most converters sound better at high sample rates because their anti aliasing filter is less than optimal.

    But great converters and good programming can solve that problem.

    But, higher rates can lead to lower latency because:

    Let's say your soundcard buffer is 128 samples.
    At 44100 sample rate, this equals 128/44100 ~ 2.9 msec.
    At 96000, the same buffer is 128/96000 ~ 1.33 msec.

    Latency is measured in samples, the closer those samples are together, the less actual time it takes.

    CbB, Platinum, 64 bit throughout
    Custom built i7 3930, 32Gb RAM, 2 x 1Tb Internal HDD, 1 x 1TB system SSD (Win 7), 1 x 500Gb system SSD (Win 10), 2 x 1Tb External HDD's, Dual boot Win 7 & Win 10 64 Bit, Saffire Pro 26, ISA One, Adam P11A,
    #10
    Jump to:
    © 2025 APG vNext Commercial Version 5.1