DSPRelated.com
Forums
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →

FIR Bandpass filtering (C code)

Started by Robert Krten ●March 31, 2007
On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote:
> On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > filtered? > > > > No. I'm saying that FIR and IIR filters only make sense for > > > energy signals and power signals. These filters are studied > > > in terms of the Fourier tranform, which requires the signals > > > to me integrable(?). The stock market data are not integrable > > > in the sense required by the FT, and hence FIR and IIR filters > > > don't make sense with those sorts of data. > > > So, consider this sequence x_n given by > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > can't use an FIR to filter out the periodic componenent? Or yet > > another FIR to filter out the polynomial component? Or combine the two > > to filter out both components to find the residual e_n? > > Something may have gone missing in your expression above, > so I take the liberty to reformulate: > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > Assume for simplicity that we have N components and that > w = k/N*pi for some integer k. > > If we agree on this formulation, I put to you the following: > > 1) The ramp a*n may (or may not) have a non-zero Fourier > component at the frequency w. > 2) The cosine certainly has a non-zero Fourier component > at frequency w. > 3) The white noise does probably have a non-zero Fourier > component at frequency w. > 4) In the event that all three terms contribute with > non-zero Fourier components at frequency w, no FIR or > IIR filter will be able to separate the contributions > from each respective term. > > Rune
You answered four questions that I didn't ask. My question was simple: is it possible to filter out the periodic component in the above (non- stationary) time series with a FIR filter? Regards, Andor
On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote:
> On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > filtered? > > > > No. I'm saying that FIR and IIR filters only make sense for > > > energy signals and power signals. These filters are studied > > > in terms of the Fourier tranform, which requires the signals > > > to me integrable(?). The stock market data are not integrable > > > in the sense required by the FT, and hence FIR and IIR filters > > > don't make sense with those sorts of data. > > > So, consider this sequence x_n given by > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > can't use an FIR to filter out the periodic componenent? Or yet > > another FIR to filter out the polynomial component? Or combine the two > > to filter out both components to find the residual e_n? > > Something may have gone missing in your expression above, > so I take the liberty to reformulate: > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > Assume for simplicity that we have N components and that > w = k/N*pi for some integer k. > > If we agree on this formulation, I put to you the following: > > 1) The ramp a*n may (or may not) have a non-zero Fourier > component at the frequency w. > 2) The cosine certainly has a non-zero Fourier component > at frequency w. > 3) The white noise does probably have a non-zero Fourier > component at frequency w. > 4) In the event that all three terms contribute with > non-zero Fourier components at frequency w, no FIR or > IIR filter will be able to separate the contributions > from each respective term. > > Rune
You answered four questions that I didn't ask. My question was simple: is it possible to filter out the periodic component in the above (non- stationary) time series with a FIR filter? Regards, Andor
On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote:
> On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > filtered? > > > > No. I'm saying that FIR and IIR filters only make sense for > > > energy signals and power signals. These filters are studied > > > in terms of the Fourier tranform, which requires the signals > > > to me integrable(?). The stock market data are not integrable > > > in the sense required by the FT, and hence FIR and IIR filters > > > don't make sense with those sorts of data. > > > So, consider this sequence x_n given by > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > can't use an FIR to filter out the periodic componenent? Or yet > > another FIR to filter out the polynomial component? Or combine the two > > to filter out both components to find the residual e_n? > > Something may have gone missing in your expression above, > so I take the liberty to reformulate: > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > Assume for simplicity that we have N components and that > w = k/N*pi for some integer k. > > If we agree on this formulation, I put to you the following: > > 1) The ramp a*n may (or may not) have a non-zero Fourier > component at the frequency w. > 2) The cosine certainly has a non-zero Fourier component > at frequency w. > 3) The white noise does probably have a non-zero Fourier > component at frequency w. > 4) In the event that all three terms contribute with > non-zero Fourier components at frequency w, no FIR or > IIR filter will be able to separate the contributions > from each respective term. > > Rune
You answered four questions that I didn't ask. My question was simple: is it possible to filter out the periodic component in the above (non- stationary) time series with a FIR filter? Regards, Andor
On 3 Apr, 09:25, "Andor" <andor.bari...@gmail.com> wrote:
> On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > > On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > > filtered? > > > > > No. I'm saying that FIR and IIR filters only make sense for > > > > energy signals and power signals. These filters are studied > > > > in terms of the Fourier tranform, which requires the signals > > > > to me integrable(?). The stock market data are not integrable > > > > in the sense required by the FT, and hence FIR and IIR filters > > > > don't make sense with those sorts of data. > > > > So, consider this sequence x_n given by > > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > > can't use an FIR to filter out the periodic componenent? Or yet > > > another FIR to filter out the polynomial component? Or combine the two > > > to filter out both components to find the residual e_n? > > > Something may have gone missing in your expression above, > > so I take the liberty to reformulate: > > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > > Assume for simplicity that we have N components and that > > w = k/N*pi for some integer k. > > > If we agree on this formulation, I put to you the following: > > > 1) The ramp a*n may (or may not) have a non-zero Fourier > > component at the frequency w. > > 2) The cosine certainly has a non-zero Fourier component > > at frequency w. > > 3) The white noise does probably have a non-zero Fourier > > component at frequency w. > > 4) In the event that all three terms contribute with > > non-zero Fourier components at frequency w, no FIR or > > IIR filter will be able to separate the contributions > > from each respective term. > > > Rune > > You answered four questions that I didn't ask.
Because the phrasing of your post was and is ambiguous.
> My question was simple: > is it possible to filter out the periodic component in the above (non- > stationary) time series with a FIR filter?
The answer depends on exactly what you try to ask. If you by "the periodic component" means the term b*cos(w*n) -- and this is how most people would understand the term -- then the answer is an unambiguous "No", the argument already being given. Rune
On 3 Apr., 09:43, "Rune Allnor" <all...@tele.ntnu.no> wrote:
> On 3 Apr, 09:25, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > > > filtered? > > > > > > No. I'm saying that FIR and IIR filters only make sense for > > > > > energy signals and power signals. These filters are studied > > > > > in terms of the Fourier tranform, which requires the signals > > > > > to me integrable(?). The stock market data are not integrable > > > > > in the sense required by the FT, and hence FIR and IIR filters > > > > > don't make sense with those sorts of data. > > > > > So, consider this sequence x_n given by > > > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > > > can't use an FIR to filter out the periodic componenent? Or yet > > > > another FIR to filter out the polynomial component? Or combine the two > > > > to filter out both components to find the residual e_n? > > > > Something may have gone missing in your expression above, > > > so I take the liberty to reformulate: > > > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > > > Assume for simplicity that we have N components and that > > > w = k/N*pi for some integer k. > > > > If we agree on this formulation, I put to you the following: > > > > 1) The ramp a*n may (or may not) have a non-zero Fourier > > > component at the frequency w. > > > 2) The cosine certainly has a non-zero Fourier component > > > at frequency w. > > > 3) The white noise does probably have a non-zero Fourier > > > component at frequency w. > > > 4) In the event that all three terms contribute with > > > non-zero Fourier components at frequency w, no FIR or > > > IIR filter will be able to separate the contributions > > > from each respective term. > > > > Rune > > > You answered four questions that I didn't ask. > > Because the phrasing of your post was and is ambiguous. > > > My question was simple: > > is it possible to filter out the periodic component in the above (non- > > stationary) time series with a FIR filter? > > The answer depends on exactly what you try to ask.
Gee, I'd think my question was rather clear.
> If you by > "the periodic component" means the term b*cos(w*n) -- and this > is how most people would understand the term
Me too.
> -- then the answer > is an unambiguous "No", the argument already being given.
Then apply the FIR [1 -2*cos(w_0) 1] to the data and see what happens. Miracle: the periodic component is filtered out! Regards, Andor
On 3 Apr., 09:43, "Rune Allnor" <all...@tele.ntnu.no> wrote:
> On 3 Apr, 09:25, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > > > filtered? > > > > > > No. I'm saying that FIR and IIR filters only make sense for > > > > > energy signals and power signals. These filters are studied > > > > > in terms of the Fourier tranform, which requires the signals > > > > > to me integrable(?). The stock market data are not integrable > > > > > in the sense required by the FT, and hence FIR and IIR filters > > > > > don't make sense with those sorts of data. > > > > > So, consider this sequence x_n given by > > > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > > > can't use an FIR to filter out the periodic componenent? Or yet > > > > another FIR to filter out the polynomial component? Or combine the two > > > > to filter out both components to find the residual e_n? > > > > Something may have gone missing in your expression above, > > > so I take the liberty to reformulate: > > > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > > > Assume for simplicity that we have N components and that > > > w = k/N*pi for some integer k. > > > > If we agree on this formulation, I put to you the following: > > > > 1) The ramp a*n may (or may not) have a non-zero Fourier > > > component at the frequency w. > > > 2) The cosine certainly has a non-zero Fourier component > > > at frequency w. > > > 3) The white noise does probably have a non-zero Fourier > > > component at frequency w. > > > 4) In the event that all three terms contribute with > > > non-zero Fourier components at frequency w, no FIR or > > > IIR filter will be able to separate the contributions > > > from each respective term. > > > > Rune > > > You answered four questions that I didn't ask. > > Because the phrasing of your post was and is ambiguous. > > > My question was simple: > > is it possible to filter out the periodic component in the above (non- > > stationary) time series with a FIR filter? > > The answer depends on exactly what you try to ask.
Gee, I'd think my question was rather clear.
> If you by > "the periodic component" means the term b*cos(w*n) -- and this > is how most people would understand the term
Me too.
> -- then the answer > is an unambiguous "No", the argument already being given.
Then apply the FIR [1 -2*cos(w_0) 1] to the data and see what happens. Miracle: the periodic component is filtered out! Regards, Andor
On 3 Apr., 09:43, "Rune Allnor" <all...@tele.ntnu.no> wrote:
> On 3 Apr, 09:25, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > > > filtered? > > > > > > No. I'm saying that FIR and IIR filters only make sense for > > > > > energy signals and power signals. These filters are studied > > > > > in terms of the Fourier tranform, which requires the signals > > > > > to me integrable(?). The stock market data are not integrable > > > > > in the sense required by the FT, and hence FIR and IIR filters > > > > > don't make sense with those sorts of data. > > > > > So, consider this sequence x_n given by > > > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > > > can't use an FIR to filter out the periodic componenent? Or yet > > > > another FIR to filter out the polynomial component? Or combine the two > > > > to filter out both components to find the residual e_n? > > > > Something may have gone missing in your expression above, > > > so I take the liberty to reformulate: > > > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > > > Assume for simplicity that we have N components and that > > > w = k/N*pi for some integer k. > > > > If we agree on this formulation, I put to you the following: > > > > 1) The ramp a*n may (or may not) have a non-zero Fourier > > > component at the frequency w. > > > 2) The cosine certainly has a non-zero Fourier component > > > at frequency w. > > > 3) The white noise does probably have a non-zero Fourier > > > component at frequency w. > > > 4) In the event that all three terms contribute with > > > non-zero Fourier components at frequency w, no FIR or > > > IIR filter will be able to separate the contributions > > > from each respective term. > > > > Rune > > > You answered four questions that I didn't ask. > > Because the phrasing of your post was and is ambiguous. > > > My question was simple: > > is it possible to filter out the periodic component in the above (non- > > stationary) time series with a FIR filter? > > The answer depends on exactly what you try to ask.
Gee, I'd think my question was rather clear.
> If you by > "the periodic component" means the term b*cos(w*n) -- and this > is how most people would understand the term
Me too.
> -- then the answer > is an unambiguous "No", the argument already being given.
Then apply the FIR [1 -2*cos(w_0) 1] to the data and see what happens. Miracle: the periodic component is filtered out! Regards, Andor
On 3 Apr, 10:01, "Andor" <andor.bari...@gmail.com> wrote:
> On 3 Apr., 09:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > > On 3 Apr, 09:25, "Andor" <andor.bari...@gmail.com> wrote: > > > > On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > > > > filtered? > > > > > > > No. I'm saying that FIR and IIR filters only make sense for > > > > > > energy signals and power signals. These filters are studied > > > > > > in terms of the Fourier tranform, which requires the signals > > > > > > to me integrable(?). The stock market data are not integrable > > > > > > in the sense required by the FT, and hence FIR and IIR filters > > > > > > don't make sense with those sorts of data. > > > > > > So, consider this sequence x_n given by > > > > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > > > > can't use an FIR to filter out the periodic componenent? Or yet > > > > > another FIR to filter out the polynomial component? Or combine the two > > > > > to filter out both components to find the residual e_n? > > > > > Something may have gone missing in your expression above, > > > > so I take the liberty to reformulate: > > > > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > > > > Assume for simplicity that we have N components and that > > > > w = k/N*pi for some integer k. > > > > > If we agree on this formulation, I put to you the following: > > > > > 1) The ramp a*n may (or may not) have a non-zero Fourier > > > > component at the frequency w. > > > > 2) The cosine certainly has a non-zero Fourier component > > > > at frequency w. > > > > 3) The white noise does probably have a non-zero Fourier > > > > component at frequency w. > > > > 4) In the event that all three terms contribute with > > > > non-zero Fourier components at frequency w, no FIR or > > > > IIR filter will be able to separate the contributions > > > > from each respective term. > > > > > Rune > > > > You answered four questions that I didn't ask. > > > Because the phrasing of your post was and is ambiguous. > > > > My question was simple: > > > is it possible to filter out the periodic component in the above (non- > > > stationary) time series with a FIR filter? > > > The answer depends on exactly what you try to ask. > > Gee, I'd think my question was rather clear. > > > If you by > > "the periodic component" means the term b*cos(w*n) -- and this > > is how most people would understand the term > > Me too. > > > -- then the answer > > is an unambiguous "No", the argument already being given. > > Then apply the FIR [1 -2*cos(w_0) 1] to the data and see what happens. > Miracle: the periodic component is filtered out!
No. Not "the" periodic component; "a" periodic component. Try the same excercise with b = 0 and see what happens. "Mystery": A periodic component which "does not exist in the data" is filtered out! The insights as gained by the indicated excercise is what distinguishes a competent data analyst from an arbitrary numericist. The data analyst aims at learaning from the data something he did not know before, and attempts to relates the results of the analysis to whatever he is intersted in learning. The numericist applies the algorithm and accepts any result which does not result in a numerical exception like divide by 0 or overflow. Rune
On 3 Apr., 12:42, "Rune Allnor" <all...@tele.ntnu.no> wrote:
> On 3 Apr, 10:01, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 3 Apr., 09:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > On 3 Apr, 09:25, "Andor" <andor.bari...@gmail.com> wrote: > > > > > On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > > > > > filtered? > > > > > > > > No. I'm saying that FIR and IIR filters only make sense for > > > > > > > energy signals and power signals. These filters are studied > > > > > > > in terms of the Fourier tranform, which requires the signals > > > > > > > to me integrable(?). The stock market data are not integrable > > > > > > > in the sense required by the FT, and hence FIR and IIR filters > > > > > > > don't make sense with those sorts of data. > > > > > > > So, consider this sequence x_n given by > > > > > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > > > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > > > > > can't use an FIR to filter out the periodic componenent? Or yet > > > > > > another FIR to filter out the polynomial component? Or combine the two > > > > > > to filter out both components to find the residual e_n? > > > > > > Something may have gone missing in your expression above, > > > > > so I take the liberty to reformulate: > > > > > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > > > > > Assume for simplicity that we have N components and that > > > > > w = k/N*pi for some integer k. > > > > > > If we agree on this formulation, I put to you the following: > > > > > > 1) The ramp a*n may (or may not) have a non-zero Fourier > > > > > component at the frequency w. > > > > > 2) The cosine certainly has a non-zero Fourier component > > > > > at frequency w. > > > > > 3) The white noise does probably have a non-zero Fourier > > > > > component at frequency w. > > > > > 4) In the event that all three terms contribute with > > > > > non-zero Fourier components at frequency w, no FIR or > > > > > IIR filter will be able to separate the contributions > > > > > from each respective term. > > > > > > Rune > > > > > You answered four questions that I didn't ask. > > > > Because the phrasing of your post was and is ambiguous. > > > > > My question was simple: > > > > is it possible to filter out the periodic component in the above (non- > > > > stationary) time series with a FIR filter? > > > > The answer depends on exactly what you try to ask. > > > Gee, I'd think my question was rather clear. > > > > If you by > > > "the periodic component" means the term b*cos(w*n) -- and this > > > is how most people would understand the term > > > Me too. > > > > -- then the answer > > > is an unambiguous "No", the argument already being given. > > > Then apply the FIR [1 -2*cos(w_0) 1] to the data and see what happens. > > Miracle: the periodic component is filtered out! > > No. Not "the" periodic component; "a" periodic component. > Try the same excercise with b = 0 and see what happens. > "Mystery": A periodic component which "does not exist in the > data" is filtered out!
If it's not there you can't filter it out. Your replies are getting more mysterious as we go along.
> > The insights as gained by the indicated excercise is what > distinguishes a competent data analyst from an arbitrary > numericist. The data analyst aims at learaning from the > data something he did not know before, and attempts to > relates the results of the analysis to whatever he is > intersted in learning. The numericist applies the algorithm > and accepts any result which does not result in a numerical > exception like divide by 0 or overflow.
You seem to be in the mood for answering questions that nobody asked. Regards, Andor
On 3 Apr., 12:42, "Rune Allnor" <all...@tele.ntnu.no> wrote:
> On 3 Apr, 10:01, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 3 Apr., 09:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > On 3 Apr, 09:25, "Andor" <andor.bari...@gmail.com> wrote: > > > > > On 2 Apr., 22:46, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > On 2 Apr, 22:10, "Andor" <andor.bari...@gmail.com> wrote: > > > > > > > On 2 Apr., 21:43, "Rune Allnor" <all...@tele.ntnu.no> wrote: > > > > > > > > It's no limitation. Are you saying that only zero-mean data can be > > > > > > > > filtered? > > > > > > > > No. I'm saying that FIR and IIR filters only make sense for > > > > > > > energy signals and power signals. These filters are studied > > > > > > > in terms of the Fourier tranform, which requires the signals > > > > > > > to me integrable(?). The stock market data are not integrable > > > > > > > in the sense required by the FT, and hence FIR and IIR filters > > > > > > > don't make sense with those sorts of data. > > > > > > > So, consider this sequence x_n given by > > > > > > > x_n = alpha n + beta cos(w_0 n) + e_n, > > > > > > > where 0 < w_0 < pi is known and e_n is some noise. Are you saying I > > > > > > can't use an FIR to filter out the periodic componenent? Or yet > > > > > > another FIR to filter out the polynomial component? Or combine the two > > > > > > to filter out both components to find the residual e_n? > > > > > > Something may have gone missing in your expression above, > > > > > so I take the liberty to reformulate: > > > > > > x_n = a*n + b*cos(wn) + e_n a,b =/= 0 > > > > > > Assume for simplicity that we have N components and that > > > > > w = k/N*pi for some integer k. > > > > > > If we agree on this formulation, I put to you the following: > > > > > > 1) The ramp a*n may (or may not) have a non-zero Fourier > > > > > component at the frequency w. > > > > > 2) The cosine certainly has a non-zero Fourier component > > > > > at frequency w. > > > > > 3) The white noise does probably have a non-zero Fourier > > > > > component at frequency w. > > > > > 4) In the event that all three terms contribute with > > > > > non-zero Fourier components at frequency w, no FIR or > > > > > IIR filter will be able to separate the contributions > > > > > from each respective term. > > > > > > Rune > > > > > You answered four questions that I didn't ask. > > > > Because the phrasing of your post was and is ambiguous. > > > > > My question was simple: > > > > is it possible to filter out the periodic component in the above (non- > > > > stationary) time series with a FIR filter? > > > > The answer depends on exactly what you try to ask. > > > Gee, I'd think my question was rather clear. > > > > If you by > > > "the periodic component" means the term b*cos(w*n) -- and this > > > is how most people would understand the term > > > Me too. > > > > -- then the answer > > > is an unambiguous "No", the argument already being given. > > > Then apply the FIR [1 -2*cos(w_0) 1] to the data and see what happens. > > Miracle: the periodic component is filtered out! > > No. Not "the" periodic component; "a" periodic component. > Try the same excercise with b = 0 and see what happens. > "Mystery": A periodic component which "does not exist in the > data" is filtered out!
If it's not there you can't filter it out. Your replies are getting more mysterious as we go along.
> > The insights as gained by the indicated excercise is what > distinguishes a competent data analyst from an arbitrary > numericist. The data analyst aims at learaning from the > data something he did not know before, and attempts to > relates the results of the analysis to whatever he is > intersted in learning. The numericist applies the algorithm > and accepts any result which does not result in a numerical > exception like divide by 0 or overflow.
You seem to be in the mood for answering questions that nobody asked. Regards, Andor