Some of you probably have seen a lot of filter plots like these on DAC datasheets:
How about making these things without using specialized software like Matlab, Octave and such? They are not particularly easy to use. So many people just "see" them rather than try to figure out the meaning themselves.
As you can see, a DAC with "programmable" filters have limitations, for example, the length of filter coefficients.
Now assume there is a DAC chip allows users to make a custom 3-stage, 8x upsampling filter, you can mimic these things with SoX. Not as flexible as specicalized software suites, but fun and easy to begin with. I attached the script file (8xFIR.cmd) so there is no need to screen copy the text below:
You can change the -b parameter (steepness/depth), the k parameter (cutoff frequency), but the rule is you cannot change the -n parameter (filter length) as the DAC has limited resources. There are two set of filters, short and long to play with, you can see that the -b, k and -n parameters are duplicated three times, they are different stages of the whole filter, which control different frequency regions of the filters. Put 8xFIR.cmd into the same folder as SoX, and drag impulse.wav (attached) into 8xFIR.cmd, you will get two new wave files. Open the generated files in DeltaWave and they look like this:
Pay attention that the top of the plot is around -66dB instead of 0dB. You can control the three different filter stages, as long as you don't completely screw up the parameters, the three stages should mainly affect region A, B and C respectively.
Now zoom in the graph to see the transition region in A more clearly, these are 44.1k filters so they are somehow "wrong" as the stopband is around 23.5k, but you are the boss, you can change the script yourself. However there is a rule: you can't change parameter -n.
Zoom more into the 20-20kHz region and you can see the ripples. It is fair to say that the short filter (blue) has a passband ripple of +/- 0.002dB up to 19.3kHz (0.43764fs). For instance, the ESS "brickwall" filter is +/-0.015dB up to 0.435fs, and the "apodizing" filter is 0.075dB up to 0.409fs, according to the ES9038 datasheet. You can also see the ripple of PCM1794A and AK4499 on the screenshots above. Feel free to change the script but without changing the -n value and see how far you can go.
Apart from the attached impulse.wav, you can also drag any 44.1k audio file into the script, they will be upsampled to 352.8k with the same parameters.
How about making these things without using specialized software like Matlab, Octave and such? They are not particularly easy to use. So many people just "see" them rather than try to figure out the meaning themselves.
As you can see, a DAC with "programmable" filters have limitations, for example, the length of filter coefficients.
Now assume there is a DAC chip allows users to make a custom 3-stage, 8x upsampling filter, you can mimic these things with SoX. Not as flexible as specicalized software suites, but fun and easy to begin with. I attached the script file (8xFIR.cmd) so there is no need to screen copy the text below:
You can change the -b parameter (steepness/depth), the k parameter (cutoff frequency), but the rule is you cannot change the -n parameter (filter length) as the DAC has limited resources. There are two set of filters, short and long to play with, you can see that the -b, k and -n parameters are duplicated three times, they are different stages of the whole filter, which control different frequency regions of the filters. Put 8xFIR.cmd into the same folder as SoX, and drag impulse.wav (attached) into 8xFIR.cmd, you will get two new wave files. Open the generated files in DeltaWave and they look like this:
Pay attention that the top of the plot is around -66dB instead of 0dB. You can control the three different filter stages, as long as you don't completely screw up the parameters, the three stages should mainly affect region A, B and C respectively.
Now zoom in the graph to see the transition region in A more clearly, these are 44.1k filters so they are somehow "wrong" as the stopband is around 23.5k, but you are the boss, you can change the script yourself. However there is a rule: you can't change parameter -n.
Zoom more into the 20-20kHz region and you can see the ripples. It is fair to say that the short filter (blue) has a passband ripple of +/- 0.002dB up to 19.3kHz (0.43764fs). For instance, the ESS "brickwall" filter is +/-0.015dB up to 0.435fs, and the "apodizing" filter is 0.075dB up to 0.409fs, according to the ES9038 datasheet. You can also see the ripple of PCM1794A and AK4499 on the screenshots above. Feel free to change the script but without changing the -n value and see how far you can go.
Apart from the attached impulse.wav, you can also drag any 44.1k audio file into the script, they will be upsampled to 352.8k with the same parameters.