# Bandpass\_filter

**URL:** <https://forum.dynare.org/t/bandpass-filter/10658>\
**Category:** dseries/data/reporting\
**Created:** [30 August 2017 02:21 UTC](https://forum.dynare.org/t/bandpass-filter/10658 "2017-08-30T02:21:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabioa.riverau](https://forum.dynare.org/letter_avatar_proxy/v4/letter/f/e68b1a/32.png) [@fabioa.riverau](https://forum.dynare.org/u/fabioa.riverau)\
**Post date:** [30 August 2017 02:21 UTC](https://forum.dynare.org/t/bandpass-filter/10658/1 "2017-08-30T02:21:10Z")

</div>

Can i use bandpass\_filter using data, for example using data from datafile?

thanks in advance

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [30 August 2017 14:33 UTC](https://forum.dynare.org/t/bandpass-filter/10658/2 "2017-08-30T14:33:28Z")

</div>

What exactly do you have in mind? Chapter 6.2 in the manual on `dseries` has an example on how to use the `baxter_king_filter`. Using the `fsdat_simul.m` from the Dynare `examples`-folder, you could use

```auto
ts1 = dseries('fsdat_simul.m');
ts2=ts1.baxter_king_filter
plot(ts1.data(:,1),'-k'); % Plot of the original data.
hold on
plot(ts2.data(:,1),'--r'); % Plot of the filtered data
hold off
axis tight
id = get(gca,'XTick');
set(gca,'XTickLabel',strings(ts1.dates(id)));

```
