Physics Forums Insights
  • Physics
    • Physics Articles
    • Physics Tutorials
    • Physics Guides
    • Physics FAQs
  • Math
    • Math Articles
    • Math Tutorials
    • Math Guides
    • Math FAQs
  • Bio/Chem/Tech
    • Bio/Chem Articles
    • Computer Science Tutorials
    • Technology Guides
  • Education
    • Education Articles
    • Education Guides
  • Interviews
  • Quizzes
  • Forums
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu
digital audio guide

Sinc Function & Upsampling in Digital Audio Explained

December 14, 2023/0 Comments/in Technology Guides/by Bill Hobba
📖Read Time: 4 minutes
📊Readability: Advanced 📐 (Technical knowledge needed)
🔖Core Topics: functionsincfrequencysignalzero

Table of Contents

  • Introduction
  • The Sinc Function
    • Upsampling and Zero Insertion
    • Filtering with the Sinc Function
    • Intuitive and Mathematical Explanation
    • Symmetry of the Sinc
  • Using the Sinc Function
    • Signal Representation and Filtering
    • Practical Convolution Implementation
    • Output Array / Delay-Line Details
    • Upsampling and Reconstruction
    • Arbitrary Upsampling and D/A Conversion
    • Limit and Downsampling
    • Computational Considerations
    • Further Reading
    • More Related Articles

Introduction

This elaborates some of the claims in my insights article on digital audio.

The Sinc Function

Upsampling and Zero Insertion

The first link in my insights article has a section on filters, but I will detail the most critical case. The bit depth is assumed to be so large for all practical purposes that it is infinite, and all calculations are done at that resolution.

To clarify the statement above, we will start with two times upsampling and how it is done. You put the first sample in position one, zero in the second position, the second in position three, zero in the fourth, and so on. These zero samples add higher-frequency components to the signal if you convert it to an analog signal. So you want to get rid of it.

Filtering with the Sinc Function

Technically, this is done by convolving it with the sinc function for the frequency you want to filter.

Intuitive and Mathematical Explanation

For those more into advanced math, see the Wikipedia article: https://en.wikipedia.org/wiki/Sinc_function

For the rest of us, here is the intuitive explanation. Suppose we put an impulse function of unit height and short duration through an ideal filter with a cutoff of frequency f. Then, you get the sinc function for that cutoff frequency. In the linked Wikipedia article, you can look at one and see its function: $$ sine(x)/x $$ However, it is scaled depending on the cutoff frequency. For those who know some more advanced math, here is why. The Fourier transform of a Dirac delta function is one. Intuitively, the Fourier transform breaks down the function into its frequency spectrum. We replace it with a box function with zero outside of f and -f to band limit it. When you do an inverse Fourier transform to return to the time domain, you get the sinc function. An impulse is approximately proportional to the delta function.

Symmetry of the Sinc

It is symmetric about time t=0 with values forward and backward in time.

Using the Sinc Function

Signal Representation and Filtering

Suppose you have a signal sampled at a high frequency so each sample, for all practical purposes, is an impulse multiplied by height A, the value of the signal for that sample. You pass that through your ideal filter at frequency f. Then, you will get the sum of all the sinc functions multiplied by each sample value, A.

Practical Convolution Implementation

One way to approximate this is to sample the sinc function at the output sample frequency so you have an array of sampled numbers S(n) stored in memory. For a sinc function, that memory would need to be of infinite length, but since we can only keep numbers of finite precision after some length L, they will all be zero.

Output Array / Delay-Line Details

You have an array O(n) of length L. When a sample comes in, you first output O(1) and shift all the values down so O(n+1) is moved to O(n), leaving O(L) as zero. You multiply the sample by sinc value S(n) and add it to O(n). You keep repeating as signal samples arrive. This is called convolving with the sinc function.

Upsampling and Reconstruction

This way, the digital signal is filtered at frequency f (at least approximately). This is done to the signal sampled at 2f when upsampled to 4f using zero for the missing samples, so the signal is the same as the original, but now sampled at 4f instead of 2f.

Arbitrary Upsampling and D/A Conversion

Of course, you can upsample it to any frequency you like. You pad the extra values with zeroes. When the frequency is very high, you get a good reconstruction of the original signal that is practically continuous because of how high the sampling is. You can make it analog by converting it to one bit with noise shaping and passing it through a low-pass filter.

Limit and Downsampling

If the limit of this process is taken (it can’t be done by an actual digital processor – but mathematically, we can analyze it and see what happens in the limit), then you get exact reproduction in that limit. The limit is called infinitely large upsampling using an infinitely long sinc filter.

Note I mentioned downsampling in my original post a couple of times. It is easy to modify the above process to downsample instead of upsample. It is an excellent exercise working out the details. Remember, in the end, you can throw away samples more significant than two times the sampling frequency.

Computational Considerations

It also gives some idea of the computing power needed for high-quality digital audio.

Further Reading

If you are a real glutton for punishment, know Lebesgue integration and functional analysis, see:

https://d-nb.info/1114893048/34

Have fun!

Bill Hobba

My favourite interest is exactly how can we view the world so what science tells us is intuitive.

More Related Articles

  • Introduction to Modern Digital Audio Concepts
    Share this entry
    • Share on Facebook
    • Share on X
    • Share on WhatsApp
    • Share on LinkedIn
    • Share on Reddit
    • Share by Mail
    https://www.physicsforums.com/insights/wp-content/uploads/2023/12/digital-audio-1.png 135 240 Bill Hobba https://www.physicsforums.com/insights/wp-content/uploads/2019/02/Physics_Forums_Insights_logo.png Bill Hobba2023-12-14 14:50:052026-02-17 08:09:43Sinc Function & Upsampling in Digital Audio Explained
    0 replies

    Leave a Reply

    Want to join the discussion?
    Feel free to contribute!

    Leave a Reply Cancel reply

    You must be logged in to post a comment.

    Trending Articles

    • Inventions and Inventors Quiz and Trivia
    • Explosion-Generated Collapsing Vacuum Bubbles Reach 20,000 Kelvin
    • Learn Partial Differentiation Without Tears
    • Introduction to Evolution: Key Concepts & FAQs Guide
    • Explore Some Sins in Physics Didactics
    • Hand-to-Hand Combat Physics — Force, Momentum, Speed
    • How to Apply Newton’s Second Law to Variable Mass Systems
    • Emergence From the Superpoint
    • Quantum Entanglement is a Kinematic Fact, not a Dynamical Effect
    • Is Spacetime Really a Continuum?

    Physics Forums

    • Classical Physics
    • Atomic and Condensed Matter
    • Quantum Physics
    • Special and General Relativity
    • Beyond the Standard Model
    • High Energy, Nuclear, Particle Physics
    • Astronomy and Astrophysics
    • Cosmology
    • Other Physics Topics

    Receive Insights Articles to Your Inbox

    Enter your email address:

    Blog Information

    • Become a Member!
    • Write for Us!
    • Table of Contents
    • Blog Author List

    Popular Topics

    astronomy (17) black holes (17) classical physics (35) cosmology (16) education (23) electromagnetism (19) general relativity (19) gravity (24) interview (21) mathematics (39) mathematics self-study (21) Physicist (26) programming (18) Quantum Field Theory (31) quantum mechanics (36) quantum physics (24) relativity (40) Special Relativity (16) technology (19) universe (21)
    2026 © Physics Forums, ALL RIGHTS RESERVED - Contact Us - Privacy Policy - About PF Insights
    • Link to X
    • Link to Facebook
    • Link to LinkedIn
    • Link to Youtube
    Link to: Modern DACs, Dither, DXD & High-Res Audio Explained Link to: Modern DACs, Dither, DXD & High-Res Audio Explained Modern DACs, Dither, DXD & High-Res Audio Explaineddigital audio introLink to: Why Division by Zero Is Impossible: 10 Mathematical Reasons Link to: Why Division by Zero Is Impossible: 10 Mathematical Reasons infinityWhy Division by Zero Is Impossible: 10 Mathematical Reasons
    Scroll to top Scroll to top Scroll to top