Bug #6
closed
Added by admin over 7 years ago.
Updated over 6 years ago.
Description
I removed a low division in the audio output to meet timing. I suspect this should be replaced with a proper low pass filter.
Files
- Related to Bug #31: HDMI Audio generate high pitch noise (Core 8) added
- Is the time between this always the same? If so can dIs the sound quality poor because I removed the divide?
- If so, does the divide happen at a consistent period? If so I can scale/multiply then divide by power of two.
- Or is the sound quality poor because I just got signed/unsigned wrong?
I guess I can simply generate/feed in a signed/unsigned sine wave and see what comes out to start with...
The biggest issue with this appears to be that I need to send signed samples. Changed that and its sounding much better.
Investigating resampling high frequencies to 48KHz with some plots in Octave. The average that I removed wasn't a bad simple low pass filter (though didn't meet timing...). The way I did it (just sample) sucks, quite frankly. Any high frequency noise is aliased down to a nice squeal. Investigating some simple 'fpga-friendly' options in Octave.
Trying out various options in Octave.
sample = current method (just take the current value), flat line at top!
mean = mean of last n samples (which did not meet timing due to expensive division)
meanfpga = mean of last 32 samples (easy division)
diff3 = at 1.79MHz apply: out = out + (in-out)*3/(48000/1790000)
difffpga = at 1.79MHz apply: out = out + (in-out)/16 (i.e. like 1st order RC filter)
difffpga2 = at 1.79MHz apply: out = out + (in-out)/16, then out = out + (in-out)/8 (i.e. like 2nd order RC filter)
Planning to use difffpga2, just a subtract and addition and bit shift or two.
Could look into FIR and IIR filters, but to be honest this seems very lightweight and to work well. Will implement and see what it sounds like!
- Status changed from New to Closed
- Related to Bug #69: Some TVs confused by hdmi audio added
Also available in: Atom
PDF