Stereo Tool https://forums.stereotool.com/ |
|
De-clipping filter https://forums.stereotool.com/viewtopic.php?t=3595 |
Page 1 of 6 |
Author: | hvz [ Mon Mar 21, 2011 12:55 am ] |
Post subject: | De-clipping filter |
This is available in the Omnia 9 (Leif Claesson's box), and it has a very impressive effect on the audio. Actually I've been looking into this a few months ago, but I left it due to lack of time (and I didn't expect such a big effect). Anyway, I think now that it is a must-have for any 'serious' audio processor - although there's still only one available that actually contains it (but the effect of it is really big). Stereo Tool's normal clippers (Loudness filter) outperforms almost anything else - including what is used to record CDs. So basically I first need to restore the CD sound, THEN I can clip it again ![]() My originally planned filter works very well (I used it about 10 years ago). Basically it can 'predict' the value of samples that are missing. But the required CPU load is completely insane (1 day for one minute of music, that was 10 years ago but it will still be slow). There are several possible way to circumvent this: - Only restore the loudest tones. Probably not a good idea. - Do what I do now in my voice vibrations filter: Here I can already detect drops in volume. If such drops coincide with clipped audio, I can increase the level again. --> Checked some waveforms, won't work. What is clipping anyway? It's basically the same as switching all the HIGHER frequency sounds (higher than the size of the clipping area) to 0 for a moment. The following idea might be more promising: Say I have a block of audio. There's clipping at samples 100-150. Audio usually doesn't change much in a very short time. So basically the frequency content of samples 0-100 and 150-250 should be roughly identical. 50-150 and 100-200 should also be roughly identical, BUT THEY ARE NOT due to the clipping. Again, what does clipping do? It introduces extra frequencies (because other sounds are cut off for a short time). So: * In the clipped part I expect extra frequencies. Question #1: What happens if I remove those? * Also, the frequencies that were also present before will be lower Great, let's just pull them up then. I'm not sure if this will work, but it's definitely worth a try - and should be very easy to test. So: 1. Take frequency content of samples 0-100 2. Take frequency content of samples 150-200 3. Take the maximum of these 2 at each frequency 4. Make sure the frequency content in range 50-150 stays below these maxima. Also for 100-200. Then boost the total volume so the volume for the existing samples does not change. The good thing is: I can do this for ANY sample, and then just take the new output values only for clipped samples (and a small surrounding area to avoid crackling effects). |
Author: | Bojcha [ Mon Mar 21, 2011 3:24 am ] |
Post subject: | Re: De-clipping filter |
http://www.claessonedwards.com/forum/vi ... f=5&t=1750 |
Author: | garfield [ Mon Mar 21, 2011 1:09 pm ] |
Post subject: | Re: De-clipping filter |
Hans => have try "relife" of terry west , it's a vst plugin : http://www.terrywest.nl/utils.html ![]() |
Author: | hvz [ Mon Mar 21, 2011 1:53 pm ] |
Post subject: | Re: De-clipping filter |
MUCH MUCH MUCH better solution - I think with this I can restore ANY clipped samples very reliably: - Calculate the Fourier transform of the audio. But IGNORE clipped samples, and instead increase the importance of non-clipped samples. This can be done using a non-optimized Fourier transform implementation. - Then calculate the inverse transform. Done! If no clipping occurs, this has no effect on the audio. If clipping DOES occur, its effect will at the very least be reduced a lot. (There may be some issues at very low frequencies, especially if the clipped area is big). Note that this process should restore ANY clipping issues, also (or even especially) very short spikes etc. Also, this won't introduce any extra latency. This should take less than 100 lines of code. ![]() ![]() ![]() |
Author: | Bojcha [ Mon Mar 21, 2011 2:01 pm ] |
Post subject: | Re: De-clipping filter |
As i saw in presentation..important thing is quality of input, should be accurate because of detection! I read that in box is Intel i7, so "realtime" processing needed much CPU usage. I guess all cores! |
Author: | hvz [ Mon Mar 21, 2011 3:35 pm ] |
Post subject: | Re: De-clipping filter |
Quote: As i saw in presentation..important thing is quality of input, should be accurate because of detection!
True, to be able to decide which samples I should ignore I need to know which samples are clipped! Alternatively I could also reduce the importance of samples near the top/bottom of the signal. And figure out how this 'tilt' thing works - that's probably the same that is needed to calibrate the FM output, if I understand the physical properties of analog connections I might be able to make that a lot easier as well.I read that in box is Intel i7, so "realtime" processing needed much CPU usage. I guess all cores! i7: I don't know if it is fully used. I could imagine that it is though - see my other 'wanted features' post which would increase the Stereo Tool CPU load by a factor 4 (and even more to get rid of even more artifacts). Leif told me that he's using twice as much overlap as I do (basically that would correspond to setting the Quality slider to 200%... As I had posted somewhere on this earlier as well). |
Author: | Bojcha [ Mon Mar 21, 2011 3:51 pm ] |
Post subject: | Re: De-clipping filter |
all make sense.... About Tilt. It's same as ST's "Calibrate Phase Difference" but all in one slider. That's why i asked for Link 'checkbox' for those sliders. and same for "normal Output" Now it's important to be at Input. Maybe you'll finally now make better Scope for ST ![]() |
Author: | Brian [ Mon Mar 21, 2011 6:50 pm ] |
Post subject: | Re: De-clipping filter |
Quote:
i7: I don't know if it is fully used. I could imagine that it is though - see my other 'wanted features' post which would increase the Stereo Tool CPU load by a factor 4 (and even more to get rid of even more artifacts). Leif told me that he's using twice as much overlap as I do (basically that would correspond to setting the Quality slider to 200%... As I had posted somewhere on this earlier as well).
Given that quite a few people may be lagging behind on significantly older processors, could you make sure that if you enable this kind of processing, that you make it so that it can be toggled off/on?
|
Author: | hvz [ Mon Mar 21, 2011 11:15 pm ] |
Post subject: | Re: De-clipping filter |
@Brian: Of course! (As with any other setting). I think I've found an even simpler way to restore peaks (basically this is identical to what I described above, but MUCH easier - hence more efficient - to calculate): - Take a block of audio - Multiply each sample with the chance [0..1] that it's a valid sample (ie. not clipped) - Treat these chance-values also as a block of audio - For both blocks (multiplied by chance, and the chance itself), calculate the frequency content - Finally, divide the multiplied by chance frequency content and phase (complex values) by the chance (also complex values). Edit: O. No, this won't work ![]() Hm, and first method only doesn't work that easily. The idea is probably fine, but its not so easy to do. Still thinking... |
Author: | hvz [ Wed Mar 23, 2011 2:51 am ] |
Post subject: | Re: De-clipping filter |
Interesting observation: - Sine wave (sweep) - 1 channel normal, 1 channel clipped - Stereo Image filter: 'Phase' = 0 --> almost no effect (only the lowest bass looks slightly better) - Stereo Image filter: 'Width' = 0 --> looks MUCH better, clipping no longer visible! So apparently the PHASE of the signal does not need to be changed, only the AMPLITUDE. And that is good news, because so far my calculations had the most problems with determining the phase. |
Page 1 of 6 | All times are UTC+02:00 |
Powered by phpBB® Forum Software © phpBB Limited https://www.phpbb.com/ |