cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

What approach does the "deconvolve" function in Prime take?

hchin
1-Visitor

What approach does the "deconvolve" function in Prime take?

Is there documentation on this?

17 REPLIES 17
RichardJ
19-Tanzanite
(To:hchin)

I'm sure it's the same as in the Mathcad 15 Signal Processing extension pack. See the attached pdf.

hchin
1-Visitor
(To:RichardJ)

I'm also wondering about how the zero-divides are avoided.  What kind

of artifacts might I expect.

I notice that "convolve" looks like it also uses the transform approach.

It will return complex numbers even given two purely real vectors.  The

imaginary components are big enough to cause problems sending the result

to the plots.

RichardJ
19-Tanzanite
(To:hchin)

I'm also wondering about how the zero-divides are avoided.  What kind

of artifacts might I expect.

I don't think they are avoided. Division by zero will almost certainly cause an error. Division by something very close to zero may produce a big spike. Since that's close to a delta function it will result in big sinusoidal oscillations in the deconvolved data.

I notice that "convolve" looks like it also uses the transform approach.

It will return complex numbers even given two purely real vectors.  The

imaginary components are big enough to cause problems sending the result

to the plots.

Just take the real part.

hchin
1-Visitor
(To:RichardJ)

The straightforward deconvolve would be to take the transform and use it

to divide into the other transform.  But there would likely be a zero

somewhere in the denominator transform.  As I understand it, there are

techniques to keep that from being a problem.

Taking the real part works.  It's just that I had to get through the error message, look

into the intermediate results in order to find out.  Noting it in the description would have

benn helpful.

Thanks.

RichardJ
19-Tanzanite
(To:hchin)

The straightforward deconvolve would be to take the transform and use it

to divide into the other transform.  But there would likely be a zero

somewhere in the denominator transform.  As I understand it, there are

techniques to keep that from being a problem.

You can find the spike (the magnitude of the derivative is huge) and interpolate through it, then do the inverse FT. I don't think the built-in Mathcad function does anything like that though. You would have to write your own deconvolve function.

Out of curiosity, what's the physical system you are looking at where you wish to deconvolve with a function that has zeros after the FT?

hchin
1-Visitor
(To:RichardJ)

Essentially any signal that is aperiodic and bounded in time would have

a spectrum with zero crossings.  Consider the transform of a "square pulse",

or doing a "box car average".

RichardJ
19-Tanzanite
(To:hchin)

Yes, but if I want to deconvolve the line shape of the spectrum then the FT of that spectrum (i.e. the time series) would not have zero crossings, because that's the square pulse. You can't deconvolve using a sinc function anyway, because all the values outside of the time bounds are zero (in effect, outside the bounds the infinite time series was multiplied by zero).

hchin
1-Visitor
(To:RichardJ)

Say a signal A is being observed by a sensor with

characteristic B (in this example the square pulse, or window).

The received signal is C, the convolution of A and B (C:= A*B).

To get back an estimate of A, C is deconvolved against B.

Since C_tr = (A_tr)(B_tr),  A_tr is estimated by (C_tr)/(B_tr),

with the expectation of then doing the inverse transform on A_tr_est.

SInce B_tr has zero crossings and places where its magnitude

goes to zero, some care has to be taken.  Textbooks do mention

this issue and that zero elements in B_tr are changed slightly to avoid

zero-divides.  The question is what artifacts are created in the

approach taken here for that.   As noted separately, the approach

for convolution of two REAL vectors here leads to the artifact of imaginary

components in the result.

RichardJ
19-Tanzanite
(To:hchin)

Yes, I guess boxcar averaging of a time series would have this property. It's not just the zero elements that are a problem though, it's any elements that are close to zero. What "close" means depends on the noise in the signal. After the FT the noise is evenly distributed, but near the zero points the signal is of course very heavily suppressed. Division by close to zero amplifies the signal by a very large amount, but it also amplifies the noise by a very large amount (so then the noise is not evenly distributed). That noise is once again evenly distributed through the deconvolved signal after the inverse FT.

hchin
1-Visitor
(To:RichardJ)

Found this -

<https://www.ptcusercommunity.com/servlet/JiveServlet/download/4399-3-80510/8_Convolution_and_Deconvolution.pdf>

It has a suggestion, but doesn't say that it's what the builtin does.

RichardJ
19-Tanzanite
(To:hchin)

It's not a very useful suggestion. It works for theoretical signals with no noise, but for the reasons given above it won't work well with real signals.

I'm quite sure the built-in function does nothing to handle this.

The attached worksheet might help.

hchin
1-Visitor
(To:hchin)

Feeding the convolved vector and the "filter" into the

builtin deconvolve returns a reasonable estimate of the

original vector.

Explicitly doing as separate steps the transforms (using fft() ) of

the convolved vector and the padded out "filter" and then trying

to do the division (transf_sig/transf_filt) gives zero-divide exceptions.

RichardJ
19-Tanzanite
(To:hchin)

That surprises me. Can you post the worksheet?

hchin
1-Visitor
(To:RichardJ)

Here is an example page

VladimirN
24-Ruby II
(To:hchin)

Alternative Mathcad Prime functions is used ( http://www.ptc.com/cs/help/mathcad_hc/prime3_hc/index.jspx?id=deprecated_functions&action=show 😞

  • convolve(vx, vy, [t], [s])
  • deconvolve(vz, vx)

Online Mathcad Prime 3.1 help center available here: http://www.ptc.com/cs/help/mathcad_hc/prime3_hc/

Pic_1.png

RichardJ
19-Tanzanite
(To:VladimirN)

I bet it's the same function though, just with a name change.

Yes, it is.

Announcements

Top Tags