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

16-Pearl

## filter() function as in MathLab?

Does anyone know if there is a an equivalent mcad function to the filter() function in MathLab? Don’t think there is . See picture in attached file attached

I am looking at the standard SRS calculation but the recursive loop is not producing what is expected.

12 REPLIES 12
23-Emerald III
(To:JBlackhole)

You're right 'filter' does not exist in Mathcad, but it should be possible to write it as a function.

Success!
Luc

16-Pearl
(To:LucMeekes)

thought so

I had a 1st pass attempt at writing the loop for a well defined input signal but something's not right. I must have screw up the loop

Edit

response(v, C1, n) Returns a n-element vector giving the response of input vector v to an FIR or IIR filter with coefficient array C1. Uses direct evaluation of the convolution. For a long input signal, this method can be quite slow.

23-Emerald III
(To:JBlackhole)

Does this help?

Success!
Luc

16-Pearl
(To:LucMeekes)

thanks for the example. Looks it's me not being able to code the recursive scheme properly

23-Emerald III
(To:LucMeekes)

I don't want to claim that this is a perfect implementation of the Matlab 'filter' function. It comes close in some respects, but it seems the output needs to be shifted to the left.

Luc

16-Pearl
(To:LucMeekes)

Perfection is a state of mind !

Not sure what is the problem. re-worked with use of vector multiplication (looks neater!) (idea from your post !)

Normally if one was to run the scheme with 1 freq of interest and output (and plot) all the x'' then one should have the response (over time).

Regards

21-Topaz II
(To:JBlackhole)

Hi JXB,

you can find something about analog and digital filters in mathcad help, see the picture below and follow the arrow .

Further more you can find something else again searching in the community worksheets.

16-Pearl
(To:-MFra-)

Had a look at that obviously but found it not that useful. Maybe because I don't know exactly what I am looking for !

21-Topaz II
(To:JBlackhole)

A few years ago, I created some worksheets relating to analog filters and equivalent digital filters, which I, then, transferred to the community, you can search for them and see if you find something that interests you. They are published in both pdf and xmcd formats. The latter, however, at the opening present the bitmap images all out of place and so there is a bit of confusion, which does not happen in pdf files obviously.

16-Pearl
(To:-MFra-)

Thanks. 1st search returned 'Analog and Digital Low Pass Filter' with a 41Mb psd attached !

21-Topaz II
(To:JBlackhole)

Hi JXB,

are you looking for something like that? see below:

16-Pearl
(To:-MFra-)

Thanks for the suggestion but no. A simple/straightforward SRS plot (boring stuff)

I am still playing with different approach 1-program vs. 2 but this is purely cosmetic

looks like the output (time history for a given frequency and Q value) is working but if I run the recursive scheme for a range of frequency I don't get the expected plot

Announcements