[FieldTrip] Difficulty using "plotfiltresp" --- trying to plot frequency response curve on my data

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Sat May 2 17:04:40 CEST 2020

Hi Jonathon,

I don’t know what is going wrong. I have never used this functionality myself, so I would need to dig into it in order to check whether 1) I can reproduce your problem, and 2) to look for a solution.

Have you tried a different type of filter (e.g. ‘firws’) to check whether your issue is filter type dependent? As a background note, the ‘plotfiltresp’-option has been contributed by Andreas Widmann, who also contributed few advanced digital filters (which work much better than the default butterworth IIR filter), one of which being the ‘firws’. It could be that the plotfiltresp functionality has only been correctly implemented for the firws filter. If this happens to be the case, we can think about supporting this option for the other filters as well, provided the lower level code allows for this in principle. We look forward to any code improvement suggestions as PRs on github.

Besides, I’d recommend to use the matlab debugger, to investigate what’s going on. You can place a breakpoint somewhere in the code, and then step through it line by line. This way you can investigate whether cfg options are passed on correctly, and whether they are used to begin with. This is the strategy we would use to look into potential issues

Best wishes,

On 25 Apr 2020, at 01:18, Jonathon James Parker <parkerjo at stanford.edu<mailto:parkerjo at stanford.edu>> wrote:

Hi Jan:

Not sure of the proper etiquette

here if I should reply all to the thread.

Sincerest apologies, that was a transcription typo in the e-mail. I triple checked my code, and re-ran a couple test cases, and I can still not get the filter response curve to plot.

Any thoughts?


From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
Date: Wednesday, April 22, 2020 at 11:29 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] Difficulty using "plotfiltresp" --- trying to plot frequency response curve on my data

Hi Jonathon,
There’s a typo in the cfg specification: cfg.poltfiltresp should read: cfg.plotfiltresp.

Best wishes,

On 22 Apr 2020, at 20:12, Jonathon James Parker <parkerjo at stanford.edu<mailto:parkerjo at stanford.edu>> wrote:

Hi Fieldtrippers:

I am interested in looking at the Frequency response curve after applying different filter types to extract high-gamma band (70-170Hz) in my dataset.

I have used the cfg.plotfiltresp = ‘yes’ flag in running preprocessing on a subset of my data. The call to ft_preprocessing runs without issue, but there is no plot of the filter response curve.

Here is an example of the cfg I am using for the call to ft_preprocessing

 cfgi = [];
    cfgi.bpfilter = 'yes';
    cfgi.bpfreq = [l70 170];
    cfgi.bpfilttype = 'but';
    cfgi.bpinstabilityfix = 'reduce';
    cfgi.bpfiltrord = 8;
    cfgi.poltfiltresp = ‘yes’;

I searched the code of ft_preprocessing and only see the “plotfiltresp” referenced in handling the cfg. flag, thus I am guessing this parameter is simply passed to a lower level pre_proc function depending on the filter type.

Has anyone else had this problem and can offer advice on how to get this functionality to work?

I am running Fieldtrip August 2019 build.

Hope everyone is staying healthy.

Kindest regards and thank you,


Jonathon “JP" Parker MD, PhD
Resident in Neurosurgery | PGY5
Morgridge Endowed Postdoctoral Fellow
Maternal & Child Health Research Institute
Department of Neurosurgery
Stanford University
E: parkerjo at stanford.edu<mailto:parkerjo at stanford.edu>

fieldtrip mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200502/37bb102b/attachment.htm>

More information about the fieldtrip mailing list