As promised, here’s our windowed sinc calculator for building a 2x oversampling filter:
- Use the Tab or Enter keys to effect changes (most browsers), or press Calculate.
- The frequency axis is in multiples of the Nyquist frequency.
- This page is designed specifically to generate and view filters for the current sample rate doubling tutorial, hence the view of 0.50 of the original sample rate with folded frequency components and default gain value. However, you can use it to generate an arbitrary windowed-sinc lowpass. (The folded frequency components in the lower view are there to help you keep an eye on the results—they are not alias components at this point.)
- For example, a 2x upsampling filter: Set Rejection to the stop-band rejection is dB. Set Length to the number of taps you want to use (more taps for a steeper filter, but higher processing cost). Set Factor to a value less than 0.5, but as close to 0.5 as possible in order to get the maxmimum bandwidth while avoiding foldback (aliasing). Set Gain to 2.
- Tip: You can copy and paste the coefficients into a text file, and save with an extension of “.csv” if you want to read the values into a spreadsheet for further manipulation.