DSPRelated.com
Forums

dividing two signals using fft

Started by sofi June 6, 2007
i have problem regarding dividing two signals in frequency domain using
fft.i m just taking fft of two signals and then taking division like

fft_s1./fft_s2

should i use some preprocessing filter before division?

any suggestion or any one who has encountered and solved this problem?



On Jun 6, 6:08 am, "sofi" <aslam.sa...@gmail.com> wrote:
> i have problem regarding dividing two signals in frequency domain using > fft.i m just taking fft of two signals and then taking division like > > fft_s1./fft_s2 > > should i use some preprocessing filter before division? > > any suggestion or any one who has encountered and solved this problem?
What is your "problem" exactly? I don't understand from reading your post. You described a procedure, but you didn't say what the "problem" is. What is it that you want to do?
>On Jun 6, 6:08 am, "sofi" <aslam.sa...@gmail.com> wrote: >> i have problem regarding dividing two signals in frequency domain
using
>> fft.i m just taking fft of two signals and then taking division like >> >> fft_s1./fft_s2 >> >> should i use some preprocessing filter before division? >> >> any suggestion or any one who has encountered and solved this problem? > >What is your "problem" exactly? I don't understand from reading your >post. >You described a procedure, but you didn't say what the "problem" is. >What is it that you want to do? > >
Sorry for not clarifying the problem.the whole story is,i have unknown original signal s. It is assumed that s1 and s2 are signals available after filtering s through filters h1 and h2.Now i want to apply inverse filtering to signals s1 and s2 to get original signal s.Because i donot know s,inorder to see my result is accurate,i take cross correlation between two signals that are available after inverse filtering. so we have equations like this s1=conv(s,h1) s2=conv(s,h2) taking fft on both of equations fft(s1)=fft(s)fft(h1) fft(s2)=fft(s)fft(h2) dividing the two above equations,fft(s) cancels out fft(s1)/fft(s2)=fft(h1)/fft(h2) now when i correlate between left and right side,i get undefined correlation.so problem lies in division of fft of signals. may be my methodolgy is wrong.i will much appreciate any help.
On 6 Jun, 14:12, "sofi" <aslam.sa...@gmail.com> wrote:
> >On Jun 6, 6:08 am, "sofi" <aslam.sa...@gmail.com> wrote: > >> i have problem regarding dividing two signals in frequency domain > using > >> fft.i m just taking fft of two signals and then taking division like > > >> fft_s1./fft_s2 > > >> should i use some preprocessing filter before division? > > >> any suggestion or any one who has encountered and solved this problem? > > >What is your "problem" exactly? I don't understand from reading your > >post. > >You described a procedure, but you didn't say what the "problem" is. > >What is it that you want to do? > > Sorry for not clarifying the problem.the whole story is,i have unknown > original signal s. > It is assumed that s1 and s2 are signals available after filtering s > through filters h1 and h2.Now i want to apply inverse filtering to signals > s1 and s2 to get original signal s.Because i donot know s,inorder to see my > result is accurate,i take cross correlation between two signals that are > available after inverse filtering.
...
> may be my methodolgy is wrong.i will much appreciate any help
The method is wrong. If you have a system y[n] = x[n] (*) h[n] ("(*)" means convolution) then Y(w) = X(w)H(w). However, solving for H(w) as H(w) = Y(w)/X(w) is to ask for trouble. If |X(w)| ~ 0 for some w, you get a divide-by-almost-zero error which destroys the computations. It is possibl to use the Rxy cross correlation and solve for h[n] under certain constraints, like assuming h[n] to be minimum phase. Check out "Random Data" by Bendat and Piersol. Rune
sofi wrote:

> now when i correlate between left and right side,i get undefined > correlation.so problem lies in division of fft of signals. > may be my methodolgy is wrong.i will much appreciate any help.
Read "Deconvolution of images and spectra" by Jansson. http://books.google.com/books?id=tC4MAAAACAAJ& You can't divide if the FFT ever goes to zero. -- glen
sofi wrote:
>> On Jun 6, 6:08 am, "sofi" <aslam.sa...@gmail.com> wrote: >>> i have problem regarding dividing two signals in frequency domain > using >>> fft.i m just taking fft of two signals and then taking division like >>> >>> fft_s1./fft_s2 >>> >>> should i use some preprocessing filter before division? >>> >>> any suggestion or any one who has encountered and solved this problem? >> What is your "problem" exactly? I don't understand from reading your >> post. >> You described a procedure, but you didn't say what the "problem" is. >> What is it that you want to do? >> >> > > Sorry for not clarifying the problem.the whole story is,i have unknown > original signal s. > It is assumed that s1 and s2 are signals available after filtering s > through filters h1 and h2.Now i want to apply inverse filtering to signals > s1 and s2 to get original signal s.Because i donot know s,inorder to see my > result is accurate,i take cross correlation between two signals that are > available after inverse filtering. > > so we have equations like this > > s1=conv(s,h1) > s2=conv(s,h2) > > taking fft on both of equations > > fft(s1)=fft(s)fft(h1) > fft(s2)=fft(s)fft(h2) > dividing the two above equations,fft(s) cancels out > > fft(s1)/fft(s2)=fft(h1)/fft(h2) > > now when i correlate between left and right side,i get undefined > correlation.so problem lies in division of fft of signals. > may be my methodolgy is wrong.i will much appreciate any help.
Do you divide by zero at some point? Deconvolution is tricky. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
On Jun 6, 9:06 am, Jerry Avins <j...@ieee.org> wrote:
> > Do you divide by zero at some point? Deconvolution is tricky. > > Jerry
Yep, there are lots and lots of tricks and techniques that has to be learned. One "easy" modification is to do the pointwise division only if the denominator for that point is above a certain threshold. Otherwise set estimate of that point to zero. Of course, the devil is in the details (i.e., how to set the threshold). Julius
On Jun 6, 1:47 pm, julius <juli...@gmail.com> wrote:
> On Jun 6, 9:06 am, Jerry Avins <j...@ieee.org> wrote: > > > > > Do you divide by zero at some point? Deconvolution is tricky. > > > Jerry > > Yep, there are lots and lots of tricks and techniques that has to be > learned. One "easy" modification is to do the pointwise division only > if the denominator for that point is above a certain threshold. > Otherwise set estimate of that point to zero. > > Of course, the devil is in the details (i.e., how to set the > threshold). > > Julius
Julius is right about the details. But, aren't we missing a lot of other details here ? Is FFT even the right approach to solve this problem ? FFT multiplication implements circular convolution and hence we would only get an aliased version of the deconvolved input signal even if it worked (unless of course, the input signal had the last N-1 terms equal to zero). If the input signal (x(n)) extent is known, we can simply use the convolution equation: y(n) = h(1)*x(n) + ... + h(N)*x(n-N) and use the samples of y(N), ..., y(N+K), where (1, .., K) is the extent of the input signal to construct a system of linear equations in terms of x(n) and solve for x(n) (of course, h(n) must satisfy certain conditions to guarantee the full rank of the H matrix). Please correct me if I am wrong. Regards, Vijay.
On Jun 6, 2:10 pm, BERT <callm...@gmail.com> wrote:
> On Jun 6, 1:47 pm, julius <juli...@gmail.com> wrote: > > > > > On Jun 6, 9:06 am, Jerry Avins <j...@ieee.org> wrote: > > > > Do you divide by zero at some point? Deconvolution is tricky. > > > > Jerry > > > Yep, there are lots and lots of tricks and techniques that has to be > > learned. One "easy" modification is to do the pointwise division only > > if the denominator for that point is above a certain threshold. > > Otherwise set estimate of that point to zero. > > > Of course, the devil is in the details (i.e., how to set the > > threshold). > > > Julius > > Julius is right about the details. But, aren't we missing a lot of > other details here ? Is FFT even the right approach to solve this > problem ? FFT multiplication implements circular convolution and hence > we would only get an aliased version of the deconvolved input signal > even if it worked (unless of course, the input signal had the last N-1 > terms equal to zero). > > If the input signal (x(n)) extent is known, we can simply use the > convolution equation: > > y(n) = h(1)*x(n) + ... + h(N)*x(n-N) > > and use the samples of y(N), ..., y(N+K), where (1, .., K) is the > extent of the input signal to construct a system of linear equations > in terms of x(n) and solve for x(n) (of course, h(n) must satisfy > certain conditions to guarantee the full rank of the H matrix). > > Please correct me if I am wrong. > > Regards, > Vijay.
OK. I got the FFT thing backwards. What I meant to say was that y = conv(s, h1) is not the same as y = ifft(fft(s)*fft(h1)).
On 6 Jun, 19:47, julius <juli...@gmail.com> wrote:
> On Jun 6, 9:06 am, Jerry Avins <j...@ieee.org> wrote: > > > > > Do you divide by zero at some point? Deconvolution is tricky. > > > Jerry > > Yep, there are lots and lots of tricks and techniques that has to be > learned. One "easy" modification is to do the pointwise division only > if the denominator for that point is above a certain threshold. > Otherwise set estimate of that point to zero.
Doesn't work. If the denominator has a vanishing magnitude for some w, so does the numerator (why?). You are effectively messing around with a 0/0 type of expression. Rune