Csound Csound-dev Csound-tekno Search About

[Csnd] Deconvolution - is it that hard?

Date2020-05-06 15:02
FromChuckk Hubbard
Subject[Csnd] Deconvolution - is it that hard?
Hello.

I've been searching for basic deconvolution software or even a simple explanation, and not finding it, not even searching this list, except for $$$. I do not mean blind deconvolution, nor real-time, but deconvolution with a known IR. My thought is to apply this by recording an impulse in some recording setup, then record voice or other sound with the same setup - in the same session - then use the IR to remove the room and microphone effect.

I believe it could be done trivially using existing opcodes (until one of you tells me I'm wrong). Is discrete convolution not exactly the same as multiplying polynomials? That's what scaled time-shifted copies sounds like it would be. So deconvolution ought to be a cinch. You can find the first sample of the original signal, then subtract the entire IR scaled accordingly from the modified signal, find the next sample of the original, subtract the whole IR scaled and shifted accordingly from the modified, etc., to get every sample of the original.
I'm obviously not talking RT, either. But am I wrong in thinking that deconvolution would be simple in non-RT and with a known IR?

How useful this would be in getting a cleaner recording in a poor room is another question, although maybe the answer to that question would also be an answer as to why this doesn't seem to exist yet...

-Chuckk
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-06 15:05
FromChuckk Hubbard
SubjectRe: [Csnd] Deconvolution - is it that hard?
And, incidentally, I suppose blind deconvolution should be solvable using the existing methods for *factoring* polynomials... ?

On Wed, May 6, 2020 at 5:02 PM Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
Hello.

I've been searching for basic deconvolution software or even a simple explanation, and not finding it, not even searching this list, except for $$$. I do not mean blind deconvolution, nor real-time, but deconvolution with a known IR. My thought is to apply this by recording an impulse in some recording setup, then record voice or other sound with the same setup - in the same session - then use the IR to remove the room and microphone effect.

I believe it could be done trivially using existing opcodes (until one of you tells me I'm wrong). Is discrete convolution not exactly the same as multiplying polynomials? That's what scaled time-shifted copies sounds like it would be. So deconvolution ought to be a cinch. You can find the first sample of the original signal, then subtract the entire IR scaled accordingly from the modified signal, find the next sample of the original, subtract the whole IR scaled and shifted accordingly from the modified, etc., to get every sample of the original.
I'm obviously not talking RT, either. But am I wrong in thinking that deconvolution would be simple in non-RT and with a known IR?

How useful this would be in getting a cleaner recording in a poor room is another question, although maybe the answer to that question would also be an answer as to why this doesn't seem to exist yet...

-Chuckk


--
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-06 17:01
FromJustin Smith
SubjectRe: [Csnd] Deconvolution - is it that hard?
wouldn't this version of deconvolution just be a naive convolution
with the original IR with the sign inverted?

On Wed, May 6, 2020 at 7:05 AM Chuckk Hubbard  wrote:
>
> And, incidentally, I suppose blind deconvolution should be solvable using the existing methods for *factoring* polynomials... ?
>
> On Wed, May 6, 2020 at 5:02 PM Chuckk Hubbard  wrote:
>>
>> Hello.
>>
>> I've been searching for basic deconvolution software or even a simple explanation, and not finding it, not even searching this list, except for $$$. I do not mean blind deconvolution, nor real-time, but deconvolution with a known IR. My thought is to apply this by recording an impulse in some recording setup, then record voice or other sound with the same setup - in the same session - then use the IR to remove the room and microphone effect.
>>
>> I believe it could be done trivially using existing opcodes (until one of you tells me I'm wrong). Is discrete convolution not exactly the same as multiplying polynomials? That's what scaled time-shifted copies sounds like it would be. So deconvolution ought to be a cinch. You can find the first sample of the original signal, then subtract the entire IR scaled accordingly from the modified signal, find the next sample of the original, subtract the whole IR scaled and shifted accordingly from the modified, etc., to get every sample of the original.
>> I'm obviously not talking RT, either. But am I wrong in thinking that deconvolution would be simple in non-RT and with a known IR?
>>
>> How useful this would be in getting a cleaner recording in a poor room is another question, although maybe the answer to that question would also be an answer as to why this doesn't seem to exist yet...
>>
>> -Chuckk
>
>
>
> --
> http://www.badmuthahubbard.com
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-05-06 17:04
FromJustin Smith
SubjectRe: [Csnd] Deconvolution - is it that hard?
I hit send too soon. My suspicion here is that since we avoid naive
convolution (expensive!), you'd run into noise issues where the FFT
based implementation takes shortcuts, and those artifacts would be
increased if you use the FFT technique again when doing the reverse
convolution - these are information losing shortcuts in processing
that don't have a mathematical inverse.

All that said, applying the inverse of the IR might be "good enough"
for your application.

On Wed, May 6, 2020 at 9:01 AM Justin Smith  wrote:
>
> wouldn't this version of deconvolution just be a naive convolution
> with the original IR with the sign inverted?
>
> On Wed, May 6, 2020 at 7:05 AM Chuckk Hubbard  wrote:
> >
> > And, incidentally, I suppose blind deconvolution should be solvable using the existing methods for *factoring* polynomials... ?
> >
> > On Wed, May 6, 2020 at 5:02 PM Chuckk Hubbard  wrote:
> >>
> >> Hello.
> >>
> >> I've been searching for basic deconvolution software or even a simple explanation, and not finding it, not even searching this list, except for $$$. I do not mean blind deconvolution, nor real-time, but deconvolution with a known IR. My thought is to apply this by recording an impulse in some recording setup, then record voice or other sound with the same setup - in the same session - then use the IR to remove the room and microphone effect.
> >>
> >> I believe it could be done trivially using existing opcodes (until one of you tells me I'm wrong). Is discrete convolution not exactly the same as multiplying polynomials? That's what scaled time-shifted copies sounds like it would be. So deconvolution ought to be a cinch. You can find the first sample of the original signal, then subtract the entire IR scaled accordingly from the modified signal, find the next sample of the original, subtract the whole IR scaled and shifted accordingly from the modified, etc., to get every sample of the original.
> >> I'm obviously not talking RT, either. But am I wrong in thinking that deconvolution would be simple in non-RT and with a known IR?
> >>
> >> How useful this would be in getting a cleaner recording in a poor room is another question, although maybe the answer to that question would also be an answer as to why this doesn't seem to exist yet...
> >>
> >> -Chuckk
> >
> >
> >
> > --
> > http://www.badmuthahubbard.com
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-05-06 17:11
FromChuckk Hubbard
SubjectRe: [Csnd] Deconvolution - is it that hard?
Well, my application doesn't actually involve any convolution calculation except the reverse one. The first convolution happens in the air.
It also doesn't only invert the addition, but the multiplication as well. The scaling of each subtracted copy of the IR is determined by dividing the original signal by the IR. I found a few references linking polynomial long division to deconvolution, but they're written in some dialect of modern English that I'm not too fluent in...

I must be missing something, either way, because what I'm imagining has to be too simple.
Chuckk

On Wed, May 6, 2020 at 7:05 PM Justin Smith <noisesmith@gmail.com> wrote:
I hit send too soon. My suspicion here is that since we avoid naive
convolution (expensive!), you'd run into noise issues where the FFT
based implementation takes shortcuts, and those artifacts would be
increased if you use the FFT technique again when doing the reverse
convolution - these are information losing shortcuts in processing
that don't have a mathematical inverse.

All that said, applying the inverse of the IR might be "good enough"
for your application.

On Wed, May 6, 2020 at 9:01 AM Justin Smith <noisesmith@gmail.com> wrote:
>
> wouldn't this version of deconvolution just be a naive convolution
> with the original IR with the sign inverted?
>
> On Wed, May 6, 2020 at 7:05 AM Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
> >
> > And, incidentally, I suppose blind deconvolution should be solvable using the existing methods for *factoring* polynomials... ?
> >
> > On Wed, May 6, 2020 at 5:02 PM Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
> >>
> >> Hello.
> >>
> >> I've been searching for basic deconvolution software or even a simple explanation, and not finding it, not even searching this list, except for $$$. I do not mean blind deconvolution, nor real-time, but deconvolution with a known IR. My thought is to apply this by recording an impulse in some recording setup, then record voice or other sound with the same setup - in the same session - then use the IR to remove the room and microphone effect.
> >>
> >> I believe it could be done trivially using existing opcodes (until one of you tells me I'm wrong). Is discrete convolution not exactly the same as multiplying polynomials? That's what scaled time-shifted copies sounds like it would be. So deconvolution ought to be a cinch. You can find the first sample of the original signal, then subtract the entire IR scaled accordingly from the modified signal, find the next sample of the original, subtract the whole IR scaled and shifted accordingly from the modified, etc., to get every sample of the original.
> >> I'm obviously not talking RT, either. But am I wrong in thinking that deconvolution would be simple in non-RT and with a known IR?
> >>
> >> How useful this would be in getting a cleaner recording in a poor room is another question, although maybe the answer to that question would also be an answer as to why this doesn't seem to exist yet...
> >>
> >> -Chuckk
> >
> >
> >
> > --
> > http://www.badmuthahubbard.com
> > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


--
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-06 17:29
FromJustin Smith
SubjectRe: [Csnd] Deconvolution - is it that hard?
What I'm saying is that the deconvolution would just be the original
IR with inverse sign - the scaling is already handled by the
convolution algorithm.

The approach you describe would work well if the mic and source were
in fixed positions, any variation would lead to phase errors.

On Wed, May 6, 2020 at 9:12 AM Chuckk Hubbard  wrote:
>
> Well, my application doesn't actually involve any convolution calculation except the reverse one. The first convolution happens in the air.
> It also doesn't only invert the addition, but the multiplication as well. The scaling of each subtracted copy of the IR is determined by dividing the original signal by the IR. I found a few references linking polynomial long division to deconvolution, but they're written in some dialect of modern English that I'm not too fluent in...
>
> I must be missing something, either way, because what I'm imagining has to be too simple.
> Chuckk
>
> On Wed, May 6, 2020 at 7:05 PM Justin Smith  wrote:
>>
>> I hit send too soon. My suspicion here is that since we avoid naive
>> convolution (expensive!), you'd run into noise issues where the FFT
>> based implementation takes shortcuts, and those artifacts would be
>> increased if you use the FFT technique again when doing the reverse
>> convolution - these are information losing shortcuts in processing
>> that don't have a mathematical inverse.
>>
>> All that said, applying the inverse of the IR might be "good enough"
>> for your application.
>>
>> On Wed, May 6, 2020 at 9:01 AM Justin Smith  wrote:
>> >
>> > wouldn't this version of deconvolution just be a naive convolution
>> > with the original IR with the sign inverted?
>> >
>> > On Wed, May 6, 2020 at 7:05 AM Chuckk Hubbard  wrote:
>> > >
>> > > And, incidentally, I suppose blind deconvolution should be solvable using the existing methods for *factoring* polynomials... ?
>> > >
>> > > On Wed, May 6, 2020 at 5:02 PM Chuckk Hubbard  wrote:
>> > >>
>> > >> Hello.
>> > >>
>> > >> I've been searching for basic deconvolution software or even a simple explanation, and not finding it, not even searching this list, except for $$$. I do not mean blind deconvolution, nor real-time, but deconvolution with a known IR. My thought is to apply this by recording an impulse in some recording setup, then record voice or other sound with the same setup - in the same session - then use the IR to remove the room and microphone effect.
>> > >>
>> > >> I believe it could be done trivially using existing opcodes (until one of you tells me I'm wrong). Is discrete convolution not exactly the same as multiplying polynomials? That's what scaled time-shifted copies sounds like it would be. So deconvolution ought to be a cinch. You can find the first sample of the original signal, then subtract the entire IR scaled accordingly from the modified signal, find the next sample of the original, subtract the whole IR scaled and shifted accordingly from the modified, etc., to get every sample of the original.
>> > >> I'm obviously not talking RT, either. But am I wrong in thinking that deconvolution would be simple in non-RT and with a known IR?
>> > >>
>> > >> How useful this would be in getting a cleaner recording in a poor room is another question, although maybe the answer to that question would also be an answer as to why this doesn't seem to exist yet...
>> > >>
>> > >> -Chuckk
>> > >
>> > >
>> > >
>> > > --
>> > > http://www.badmuthahubbard.com
>> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
>
> --
> http://www.badmuthahubbard.com
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-05-06 18:08
FromChuckk Hubbard
SubjectRe: [Csnd] Deconvolution - is it that hard?
Is deconvolution not this?

On Wed, May 6, 2020 at 7:29 PM Justin Smith <noisesmith@gmail.com> wrote:
What I'm saying is that the deconvolution would just be the original
IR with inverse sign - the scaling is already handled by the
convolution algorithm.

The approach you describe would work well if the mic and source were
in fixed positions, any variation would lead to phase errors.

On Wed, May 6, 2020 at 9:12 AM Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
>
> Well, my application doesn't actually involve any convolution calculation except the reverse one. The first convolution happens in the air.
> It also doesn't only invert the addition, but the multiplication as well. The scaling of each subtracted copy of the IR is determined by dividing the original signal by the IR. I found a few references linking polynomial long division to deconvolution, but they're written in some dialect of modern English that I'm not too fluent in...
>
> I must be missing something, either way, because what I'm imagining has to be too simple.
> Chuckk
>
> On Wed, May 6, 2020 at 7:05 PM Justin Smith <noisesmith@gmail.com> wrote:
>>
>> I hit send too soon. My suspicion here is that since we avoid naive
>> convolution (expensive!), you'd run into noise issues where the FFT
>> based implementation takes shortcuts, and those artifacts would be
>> increased if you use the FFT technique again when doing the reverse
>> convolution - these are information losing shortcuts in processing
>> that don't have a mathematical inverse.
>>
>> All that said, applying the inverse of the IR might be "good enough"
>> for your application.
>>
>> On Wed, May 6, 2020 at 9:01 AM Justin Smith <noisesmith@gmail.com> wrote:
>> >
>> > wouldn't this version of deconvolution just be a naive convolution
>> > with the original IR with the sign inverted?
>> >
>> > On Wed, May 6, 2020 at 7:05 AM Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
>> > >
>> > > And, incidentally, I suppose blind deconvolution should be solvable using the existing methods for *factoring* polynomials... ?
>> > >
>> > > On Wed, May 6, 2020 at 5:02 PM Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
>> > >>
>> > >> Hello.
>> > >>
>> > >> I've been searching for basic deconvolution software or even a simple explanation, and not finding it, not even searching this list, except for $$$. I do not mean blind deconvolution, nor real-time, but deconvolution with a known IR. My thought is to apply this by recording an impulse in some recording setup, then record voice or other sound with the same setup - in the same session - then use the IR to remove the room and microphone effect.
>> > >>
>> > >> I believe it could be done trivially using existing opcodes (until one of you tells me I'm wrong). Is discrete convolution not exactly the same as multiplying polynomials? That's what scaled time-shifted copies sounds like it would be. So deconvolution ought to be a cinch. You can find the first sample of the original signal, then subtract the entire IR scaled accordingly from the modified signal, find the next sample of the original, subtract the whole IR scaled and shifted accordingly from the modified, etc., to get every sample of the original.
>> > >> I'm obviously not talking RT, either. But am I wrong in thinking that deconvolution would be simple in non-RT and with a known IR?
>> > >>
>> > >> How useful this would be in getting a cleaner recording in a poor room is another question, although maybe the answer to that question would also be an answer as to why this doesn't seem to exist yet...
>> > >>
>> > >> -Chuckk
>> > >
>> > >
>> > >
>> > > --
>> > > http://www.badmuthahubbard.com
>> > > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
>
> --
> http://www.badmuthahubbard.com
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


--
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here