ModPlug Central

OpenMPT Development (Archive) => Feature Requests => Feature Request Archive => Topic started by: BooT-SectoR-ViruZ on May 04, 2007, 07:46:54

Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on May 04, 2007, 07:46:54
i don't think this will be possible at all, but it would imho be a freaking nice feature.

ofcause you can kill the dc delay / phase shifting with some wave-editor after rendering your file to .wav, but that will be of no use when performing live with ompt.
(began to think about this problem after i listened to the recording of my gig in leipzig on april 20th... some instruments with stereo vst effects just couldn't be heard...)

i also had another feature request in mind 5 minutes ago, but unfortunately i forgot

:?
Title: [DECLINED] realtime dc offset removal
Post by: LPChip on May 04, 2007, 07:50:30
When I read your post, I see you being enthousiastic about your idea, but not really what your idea will do, and how it will work.

Can you elaborate this a bit more?
Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on May 04, 2007, 10:54:22
unfortunately i'm not a big specialist with the technical stuff,
so please tell me what it will do that's not to wish for....

i'd just like to have "remove dc delay" that i know from wavelab as an optional realtime process in ompt.

thx
Title: [DECLINED] realtime dc offset removal
Post by: LPChip on May 04, 2007, 11:00:22
Thanks for the clearification. This makes more sense. :D
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on May 04, 2007, 22:17:28
I'm a bit of the technical stuff, but I'm not capable to imagine what you mean by "dc delay"..
So I like to know about the result of killing it with a wave-editor, as you mentioned. What exactly is the result of that correction ?
With which function ?
Title: [DECLINED] realtime dc offset removal
Post by: Snu on May 05, 2007, 06:32:28
i have no idea what dc delay is either, and im very much into the technical stuff :p
i know that phase shifting would be a very small delay in one channel, but modplug's output shouldnt have any problem with this, the channels should be perfectly synched... and if they arent, this should be in bug reports!
Title: [DECLINED] realtime dc offset removal
Post by: Saga Musix on May 05, 2007, 11:11:53
In wavelab, there is an option called "Remove DC Offset" (we discussed that before in one of cubaxd's threads), but I don't know about a DC delay, coz DC is something on the y-axis, but phase shifting is something on the y-axis of a sample.
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on May 05, 2007, 22:36:20
I thought about the offset too, but, as Jojo says, this is an y-axis, so no time or delay involved. Phase shifting of a wave could be seen as a shift in time, but I doubt if this is theoretically correct.
Quote from: "BooT-SectoR-ViruZ"some instruments with stereo vst effects just couldn't be heard
This could be the case, if one of the channels of the stereo has a phase-inverted (180°) version of some common signal.
Not a matter of some delay of course.
Title: [DECLINED] realtime dc offset removal
Post by: Saga Musix on May 06, 2007, 09:59:45
jep. if some waveform can't be heared, it's got an inverted channel. that means:


Left Channel
\_/¯\
Right Channel
/¯\_/

You see, if you sum them together, they would always be zero.
Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on May 08, 2007, 07:43:37
ofcause i meant offset...  ::)
(this is the problem when you write requests at work...)

now let's see what wikipedia has on that one:
Quote from: "en.wikipedia.org"
DC offset is an offsetting of a signal from zero. The term originated in electronics, where it refers to a direct current voltage, but the concept has been extended to any representation of a waveform. DC offset is the mean amplitude of the waveform; if the mean amplitude is zero, there is no DC offset.

DC offset is usually undesirable. For example, in audio processing, a sound that has DC offset will not be at its loudest possible volume when normalized (because the offset consumes headroom), and this problem can possibly extend to the mix as a whole, since a sound with DC offset and a sound without DC offset will have DC offset when mixed. It may also cause other artifacts depending on what is being done with the signal.

sounds pretty much like my problem..
Title: [DECLINED] realtime dc offset removal
Post by: Snu on May 08, 2007, 17:27:01
ok, i get it now, still sounds like it should be in the bug forum rather than feature requests tho... unless its caused by vsts?
does plain mpt output have that problem, or just some vsts?
regardless, maybe there is a vst plugin that can do this
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on May 08, 2007, 23:13:41
If it's about a sample with DC offset, then it's not a bug of MPT, because it's a property of the sample. To correct this to zero could be seen as a request for adding this tool to the sample editor of MPT. But this correction should have been done with a wav-editor before importing into MPT.
Missing instruments is something else, so it's a good suggestion to test this with a plain MPT output.
Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on May 09, 2007, 08:25:05
Quote from: "Sam_Zen"If it's about a sample with DC offset, then it's not a bug of MPT, because it's a property of the sample. To correct this to zero could be seen as a request for adding this tool to the sample editor of MPT. But this correction should have been done with a wav-editor before importing into MPT.
Missing instruments is something else, so it's a good suggestion to test this with a plain MPT output.

i assume it's a problem with cheap vst effects, so no bug.
but i'm also going to do some testing with plain mpt output,
because when i was rendering a track yesterday (v .46)
i got ~6% offset, which is a freaking lot... (normally 0% - 1%)

Quote from: "Snu"maybe there is a vst plugin that can do this
according to some article on kvraudio there are some,
but having it build in would be better for mix and performance i guess
Title: [DECLINED] realtime dc offset removal
Post by: pelya on May 09, 2007, 11:09:57
Maybe write VST plugin that removes DC offset? And chain it with those VSTs that adds it  :lol: .
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on May 09, 2007, 23:47:36
Quote from: "BooT-SectoR-ViruZ"i got ~6% offset, which is a freaking lot... (normally 0% - 1%)
6 % is awful. How did you analyze this ?
Imo even 1 % is unacceptable by the way. A good formula shouldn't change the DC-offset of the output.

The DC-level at the output can be caused by any single audio-source within the mix. Having the offset at zero
means that the total energy of the negative part is in balance with the positive part of the wave.
So any element which doesn't have this, could disturb the overall balance at the output.
Devices which are known for delivering signals with a wrong DC-level are microphones and pickup elements.
Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on May 10, 2007, 10:52:17
Quote from: "Sam_Zen"
Quote from: "BooT-SectoR-ViruZ"i got ~6% offset, which is a freaking lot... (normally 0% - 1%)
6 % is awful. How did you analyze this ?

rendered my song to .wav and let wavelab 5 check on that....

funny thing is that before i remove the offset in wavelab, silent parts of the song don't show any waveform (as it's supposed to be) and after removing the offset there's a waveform without any noticeable sound.. haha

:nuts:
Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on May 10, 2007, 15:25:05
we seem to have a bug here.... (at least in v45 and v46, with which i tested)

i tested 20 different modules and all rendered wav-files had more or less dc offset.
(no vst stuff involved)

even when you create a stereo-wav-file from just a looped mono-sample
(also with removing dc offset from that sample in wavelab before)

my settings:
mixing 44.1khz
stereo 16bit
stereo separation 100%
pre-amp ~40%
polyphase resampling
no eq, no agc, no bass expansion....
Title: [DECLINED] realtime dc offset removal
Post by: LPChip on May 10, 2007, 15:50:46
Can you see if anything in the player settings is affecting this? Like EQ, Surround option, etc?

I know that rendering to wave will use these settings. Hench why you can press a button on the wav export options.
Title: [DECLINED] realtime dc offset removal
Post by: Saga Musix on May 10, 2007, 17:04:55
Quote from: "Sam_Zen"
6 % is awful. How did you analyze this ?
i guess he used wavelab :) if you use the "Remove DC" option it will show you the current offset.
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on May 10, 2007, 22:33:08
I tested XM and IT with .45 and .46 under the same circumstances, but I can't reproduce this problem so far.
Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on May 11, 2007, 06:49:04
Quote from: "LPChip"Can you see if anything in the player settings is affecting this? Like EQ, Surround option, etc?

I know that rendering to wave will use these settings. Hench why you can press a button on the wav export options.

i'll check on that during the weekend...

@sam_zen:
did you normalize/amplify your output wav-file to a normal level?
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on May 11, 2007, 07:02:46
I never use normalize in the wav export.
Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on May 11, 2007, 08:01:35
Quote from: "Sam_Zen"I never use normalize in the wav export.

me neither... i meant in the wav editor that you're checking dc offset with
Title: [DECLINED] realtime dc offset removal
Post by: Saga Musix on May 11, 2007, 15:14:06
as far as i can see, the normalize feature is not there in openMPT anymore. which is a bad choice imho. i kinda liked it.
Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on May 11, 2007, 17:44:24
Quote from: "Jojo"as far as i can see, the normalize feature is not there in openMPT anymore. which is a bad choice imho. i kinda liked it.

please keep on-topic :P
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on May 12, 2007, 00:11:09
Quotei meant in the wav editor that you're checking dc offset with
I see. As a test I exported a module to wav, then imported it in the wav editor, as is, and checked.

There are ways to localize this problem better, I think.

First, a piece of silence in the track can indicate something, because this should be just a line on zero level.
This could be tested, by adding an empty pattern with e.g. some 32 lines before the song starts.
This silence will be exported too. Then a global DC offset would look like this

(http://i1.tinypic.com/6cfcbv8.png)

Another option is to check the behaviour of the seperate channels if exported as solo. This can be done by enabling "Channel mode" in the 'Wave convert' window.
Title: [DECLINED] realtime dc offset removal
Post by: dBlues on June 17, 2007, 19:17:25
A simple way to get rid of DC-offset: as DC-offset is nothing but 0-frequency level (think of AC vs DC), you can apply a hi-pass filter VST to the master output. I usually set it to filter everything below 40Hz, this will generally improve sound clarity and stereo image.
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on June 17, 2007, 23:10:22
Quote from: "dBlues"DC-offset is nothing but 0-frequency level
Sorry, but you're simply wrong here. A DC-offset has nothing to do with the aspect of frequency.
Even a wave-frequency of 0.04 Hz or 2 MHz can have a DC-offset.

2 BooT-SectoR-ViruZ
Of course I use normalize in the wav-editor, but it would quite silly to do that first, before correcting a DC-offset.
In fact, normalisation is always the last effect I imply in the order of modifications.
Equalizing an already normalized file with some freq. boost is asking for distortions in the result.
But, as you said, this is off-topic here.
Title: [DECLINED] realtime dc offset removal
Post by: dBlues on June 18, 2007, 16:08:06
Quote from: "Sam_Zen"
Quote from: "dBlues"DC-offset is nothing but 0-frequency level
Sorry, but you're simply wrong here. A DC-offset has nothing to do with the aspect of frequency.

I believe we both are speaking of the same thing. For me it is natural to think of 0-frequency "wave". Take 0.00000000001Hz wave for example, lets say you have recorded it. It completes its oscillation every 1/0.00000000001 = 100 000 000 000 seconds. That would seem like DC offset, you could hardly see the wave move.

Quote from: "Sam_Zen"
Even a wave-frequency of 0.04 Hz or 2 MHz can have a DC-offset.

Of course. That is exactly why I would use a ~40Hz hi-pass filter to remove the DC offset.
Title: [DECLINED] realtime dc offset removal
Post by: Saga Musix on June 18, 2007, 18:40:32
errr, even IF that methoed works, it's a COMPLICATED to use it. Plus, you lose some FREQUENCIES, which means that you lose SOUND. Removing a DC offset by "moving the shape a bit up or down" is much easier and doesn't alter the signal itself.
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on June 18, 2007, 23:50:55
Quote from: "dBlues"I believe we both are speaking of the same thing
Maybe in some way about the result, as my test shows here, but as Jojo says, shifting up/down doesn't affect the signal.
Why do you think wav-editors all have a special tool for this, while it could be done with some highpass filter ?
In Cool the DC offset tool isn't even in the filter-category, but in the amplify section.

Anyway. On "a" a piece of 0.00001 Hz plus a piece of 10 kHz, with an artificial dc-offset of 15 %.
Then I did a HPF with 1 kHz, and the result is "b". I must admit that I didn't expect the 10 kHz to lower down too, so you got a point there.
Of course the 0.00001 became zero level, because it's silence then.
(http://i12.tinypic.com/5x65l4y.png)
But I still consider this offset correction as a side-effect of the filter algoritm.
Title: [DECLINED] realtime dc offset removal
Post by: dBlues on June 19, 2007, 16:48:08
The high-pass method is more effective than simply subtracting the dc-offset because this strips the harmful low-frequency waves completely. Merely "decreasing" the zero-level of the wave will keep those waves there. Of course, you can use a 20Hz hp-filter if you feel those frequencies are important in you music (you can only reach 20-50Hz on a subwoofer usually).
Title: [DECLINED] realtime dc offset removal
Post by: Saga Musix on June 19, 2007, 17:32:21
Quote from: "dBlues"strips the harmful low-frequency waves completely
stripping frequencies is just another step in music production... IMHO you should never do two things in one step when you edit audio.
Title: [DECLINED] realtime dc offset removal
Post by: dBlues on June 19, 2007, 18:28:40
Ok, if you have monster offset that is the same throughout the track, by all means use subtraction. Otherwise you will just move the offset around, not causing any improvement. Lets say you have a vsti that causes the offset (or a sample), and you only play it in one part of the song. Now if you would change offset based on this single instrument, you would mess up the offset elsewhere.
Title: [DECLINED] realtime dc offset removal
Post by: dBlues on June 19, 2007, 18:42:44
As for the original topic of phase shifting, that has nothing to do with DC-offset and as mentioned before, is probably a property of cheapo VST-effects(until proven otherwise) and therefore is not a bug at all.
Title: [DECLINED] realtime dc offset removal
Post by: Saga Musix on June 19, 2007, 19:50:33
Quote from: "dBlues"As for the original topic of phase shifting, that has nothing to do with DC-offset and as mentioned before, is probably a property of cheapo VST-effects(until proven otherwise) and therefore is not a bug at all.

lol, i gave up to count how many people misunderstood the problem :P BSV corrected himself, he meant the DC offset indeed...
Title: [DECLINED] realtime dc offset removal
Post by: Sam_Zen on June 19, 2007, 22:45:01
I give up too. Decreasing a zero is beyond my imagination :)
Title: [DECLINED] realtime dc offset removal
Post by: LPChip on June 20, 2007, 07:35:15
Quote from: "Sam_Zen"I give up too. Decreasing a zero is beyond my imagination :)

Decrease the fontsize :nuts:
Title: [DECLINED] realtime dc offset removal
Post by: bvanoudtshoorn on June 20, 2007, 10:39:39
Just an idea... Maybe it would be useful to check the offset produced by the "export" feature in mpt against the offset produced using a loopback on a soundcard.
Title: [DECLINED] realtime dc offset removal
Post by: BooT-SectoR-ViruZ on June 20, 2007, 11:06:21
news from the front:
rendered a new track with .48 yesterday that uses a hell lot of vst & vsti
(including the cheap ones i use a lot) and didn't have an insance offset.

only thing i changed while switching versions is that i now try to use xmms
resampling instead of polyphase and i also saved to 24bit wav instead of 16

so maybe that'll also solve my problem with that other track of mine...

testing results to follow in the evening although i'm short of time

.
..
...


P.S.:
ok, changing bitrate and resampling for export to wav doesn't have any effect on this...
hope i'll find some time for testing again with just plain data at the weekend...