Summing dry/wet signals

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Code: Select all

 
 	   in1_origin_signal = *in1;
 	   in2_origin_signal = *in2;
 	   ...
 	   in1_filtered = fFilters[EFilters::kLp1].Process(*in1, 0);
           in2_filtered = fFilters[EFilters::kLp1].Process(*in2, 0); 
 	   ...
           in1_leftover = in1_origin_signal - in1_filtered;
           in2_leftover = in2_origin_signal - in2_filtered;
            ...
           out1 =  in1_filtered +  in1_leftover;
           out2 =  in2_filtered +  in2_leftover;
Hello everyone. The code above uses summation of the filtered signal with the signal that was cut off at the beginning. I would like to clarify whether this is the right approach? And what nuances or correct code is needed? :hyper: :help: :hyper:

Post

It doesn't look "right" but i think i know what you're going for and it might be "better".

Post

Yeah, what do you hear?

Leftover = original - filtered
Out = filtered + leftover
So Out = filtered + original - filtered
So out = original
Really??
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

my old akai sampler had 6dB lowpass and the ability to set negative amplitude amounts, so one could subtract the lowpassed signal from the original to create a highpassed signal, at the expense of an extra voice.

dry + filtered always worked for adding the dry and the filtered signals together.

if you want to mix between dry and filtered to maintain amplitude you could use linear interpolation
out = dry + mix * (filtered - dry);
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

If this is for a crossover, on MixMaxtrix you can find a crossover using this approach (WTF crossover) and a normal Linkwitz-Riley one and compare.

This approach sums perfectly, but as soon as you modify one of the signals it gets wonky. The exception is the 1-pole case, which works acceptably.

For doing this on a crossover, your low pass should be linear-phase.

Post

jupiter8 wrote: Sat Oct 30, 2021 12:05 pm It doesn't look "right" but i think i know what you're going for and it might be "better".
Can you share some information?

Post

Code: Select all

 
in2_filtered = fFilters[EFilters::kLp1].Process(*in2, 0); 
This doesn't seem correct. Shouldn't it be EFilters::kLp2 or Process(*in2, 1);? Otherwise it seems that you use the same filter for two different signals/channels.

Post

i know i should shut up but in the old days people just typed the filter there instead of using OO for everything. jesus god people.

using OO for a 6dB lowpass is one of those crazy things. just because everyone else jumps off a cliff and chews off their own limbs in a giant bleeding heap of people who make everything three times longer to type.

would you look at what people have made you do?

there's no need to assign the values of *in1 and *in2 to other variables, especially one with retarded paragraph length names. it's essentially a token negative, something for you to accept while you focus on another problem, without seeing you have been loaded down with crap from a "helper". remember other people are evil because that's all they know.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

Vokbuz wrote: Mon Nov 01, 2021 1:24 pm

Code: Select all

 
in2_filtered = fFilters[EFilters::kLp1].Process(*in2, 0); 
This doesn't seem correct. Shouldn't it be EFilters::kLp2 or Process(*in2, 1);? Otherwise it seems that you use the same filter for two different signals/channels.

Code: Select all

 
 	   double in1_origin_signal = *in1; 
 	   double in2_origin_signal = *in2;
 	   double in1_filtered;
 	   double in2_filtered;
 	   ...
 	   in1_filtered = fFilters[EFilters::kLp1].Process(*in1, 0);
           in2_filtered = fFilters[EFilters::kLp1].Process(*in2, 0); 
           in1_filtered = fFilters[EFilters::kHp1].Process(*in1, 0);
           in2_filtered = fFilters[EFilters::kHp1].Process(*in2, 0); 
           
           // in1_filtered -> *in1 -> Lp1 + Hp1 (Low & High pass)
           // in2_filtered -> *in2 -> Lp1 + Hp1 (Low & High pass)
 	   ...
           in1_leftover = in1_origin_signal - in1_filtered;
           in2_leftover = in2_origin_signal - in2_filtered;
            ...
           out1 =  in1_filtered +  in1_leftover; //  
           out2 =  in2_filtered +  in2_leftover; // 
           
           
Etalon:
untitled (1).png
Current:
untitled (2).png
You do not have the required permissions to view the files attached to this post.

Post

BertKoor wrote: Sat Oct 30, 2021 12:27 pm Yeah, what do you hear?

Leftover = original - filtered
Out = filtered + leftover
So Out = filtered + original - filtered
So out = original
Really??
Noup))

1/ filtered = filter.process(original)
2 / leftover = original - filtered
3 / compressed = comp.process(filtered)
4 / Out = compressed + leftover

Post

As we say in Dutch: that's different cook.
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

SKyzZz wrote: Mon Nov 01, 2021 6:00 pm

Code: Select all

 

 	   in1_filtered = fFilters[EFilters::kLp1].Process(*in1, 0);
           in2_filtered = fFilters[EFilters::kLp1].Process(*in2, 0); 
           in1_filtered = fFilters[EFilters::kHp1].Process(*in1, 0);
           in2_filtered = fFilters[EFilters::kHp1].Process(*in2, 0); 
           
what you've done here is:
lowpass *in1 and assign to in1_filtered
(channel 2)
highpass *in1 ans assign to in1_filtered
(channel 2)

which disposes of the lowpass result and makes the operation unnecessary.

but basically, the main thing is, as i understand it, you are asking, "how does one sum a filtered signal with its unfiltered state" - and it seems that you don't understand, in order to do this, you do not need to involve the difference between the filtered and unfiltered signals.

if you are summing a filtered signal with the original dry signal, just add them together. there's no special hidden voodoo.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

you could do the whole thing in one line

*out1 = *in1 + myfilter(*in1);

and avoid a bunch of unnecessary variable declarations. times the whole thing by 0.5 if you want the output to have the same amplitude.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

xoxos wrote: Mon Nov 01, 2021 6:31 pm you could do the whole thing in one line

*out1 = *in1 + myfilter(*in1);

and avoid a bunch of unnecessary variable declarations. times the whole thing by 0.5 if you want the output to have the same amplitude.
Oh, if everything were easy and simple, I wouldn't write here:

out1 = in1 -> filter LP -> filter HP -> compressed + in1_leftover
out2 = in2 -> filter LP -> filter HP -> compressed + in2_leftover

According to your logic

*out1 = (*in1 + myfilterLP(*in1) + myfilterHP(*in1)) / 2; // 1 + 0.5 + 0.5 / 2 = 1
*out2 = (*in2 + myfilterLP(*in2) + myfilterHP(*in2)) / 2; //

You take the original signal and add it with the processed ones, getting an unreal volume increase!
Why??

Post

xoxos wrote: Mon Nov 01, 2021 6:26 pm
SKyzZz wrote: Mon Nov 01, 2021 6:00 pm

Code: Select all

 

 	   in1_filtered = fFilters[EFilters::kLp1].Process(*in1, 0);
           in2_filtered = fFilters[EFilters::kLp1].Process(*in2, 0); 
           in1_filtered = fFilters[EFilters::kHp1].Process(*in1, 0);
           in2_filtered = fFilters[EFilters::kHp1].Process(*in2, 0); 
           
what you've done here is:
lowpass *in1 and assign to in1_filtered
(channel 2)
highpass *in1 ans assign to in1_filtered
(channel 2)

which disposes of the lowpass result and makes the operation unnecessary.

but basically, the main thing is, as i understand it, you are asking, "how does one sum a filtered signal with its unfiltered state" - and it seems that you don't understand, in order to do this, you do not need to involve the difference between the filtered and unfiltered signals.

if you are summing a filtered signal with the original dry signal, just add them together. there's no special hidden voodoo.
There are two filters(LP+HP) and compression. This is the result of the signal being processed. I want to understand how to sum up such a processed signal AND what I cut with a conventional filter. That is, it is a compressor that filters part of the frequencies compresses what remains, but in the AND adds up the raw signal by the compressor and is processed.
untitled (4).png
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “DSP and Plugin Development”