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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

filter() function as in MathLab?

JBlackhole
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
LucMeekes
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

thought so Smiley Sad

 

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

how about

 

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.

LucMeekes
23-Emerald III
(To:JBlackhole)

Does this help?

LM_20180131_filter.png

Success!
Luc

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

LucMeekes
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

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

-MFra-
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.

For JXB.jpg

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

-MFra-
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.

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

-MFra-
21-Topaz II
(To:JBlackhole)

Hi JXB,

are you looking for something like that? see below:

FIlter output.jpg

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

Top Tags