T'ai Chi : Some math/stat questions for you

T'ai Chi said:


I agree davefoc. It is not only fun, it is educational! :) Edutainment rocks!

Oh, what the heck, if we have an FIR filter with a frequency response that is the square root of what we need, how do we get the filter we need, with no phase shift beyond a delay component?
 
1) Assuming you mean a normal distribution and are given the "normal range" then divide by 1.96 to get the SD.

Thats me done!
 
I'm not sure the question makes sense as worded now. Range is a word applied to a sample rather than a distribution. Maybe "range of support" would apply to a distribution. Every Normal distribution has infinite support. Knowing that a distribution has infinite support wouldn't give us any hint as to its standard deviation.

I think it probably should be "If we know the range of a sample from a mound-shaped distribution how can we estimate it's standard deviation?" In which case your answer makes some sense (except that it should be 2 * 1.96), although we could get a better estimate if we knew the size of the sample. As the sample size gets larger that method will tend to overestimate the standard deviation because as the sample size gets larger it becomes more likely that the max or min of it is more then 1.96 standard deviations away from the mean.
 
jj said:

Oh, what the heck, if we have an FIR filter with a frequency response that is the square root of what we need, how do we get the filter we need, with no phase shift beyond a delay component?

I can honestly say I have no clue whatsoever. Could you phrase the question only in terms of statistics? ;) I couldn't even venture a psychic guess here.

I think I need to study audio stuff some. :)
 
JJ,

Oh, what the heck, if we have an FIR filter with a frequency response that is the square root of what we need, how do we get the filter we need, with no phase shift beyond a delay component?

Well, I'm not much of an expert on time-domain filters (I use only frequency-domain filters in my work), but I'll give it a shot.

Let's imagine the impulse response function of the filter: f(t).

If f(t) is even, then there will be no phase shift, so we can simply apply the filter twice. Problem solved.

If f(t) is not even, then there will be a frequency dependant phase shift on the filtered signal. Applying the filter twice will double the phase shifts. That's no good.

If we can somehow apply the filter backwards in time, then the function response function will be f(-t). The Fourier transform of f(-t) is the complex conjugate of the Fourier transform of f(t). This means that applying the filter, followed by the time-reversal of the filter, should give the proper frequency response function, and no phase-shift.

The only problem is how to apply the filter in reverse. I would think that the implementation would depend on the circumstances. For example, if the filtering is being done digitally on a computer, it is trivial.


Dr. Stupid
 
Stimpson J. Cat said:
JJ,



Well, I'm not much of an expert on time-domain filters (I use only frequency-domain filters in my work), but I'll give it a shot.

Let's imagine the impulse response function of the filter: f(t).

If f(t) is even, then there will be no phase shift, so we can simply apply the filter twice. Problem solved.

Wrong. An even filter that is not symmetric will have phase shift, and a delay component of N/2-.5 samples.

If f(t) is not even, then there will be a frequency dependant phase shift on the filtered signal. Applying the filter twice will double the phase shifts. That's no good.

Also wrong, an odd-tap filter that is symmetric will have no phase shift, only a delay component of n/2-=.5. Notice, the ODD Filter has the integer sample delay.

In both cases, it's the symmetry about the center that is the key to a constant-delay filter, notice.

If we can somehow apply the filter backwards in time, then the function response function will be f(-t). The Fourier transform of f(-t) is the complex conjugate of the Fourier transform of f(t). This means that applying the filter, followed by the time-reversal of the filter, should give the proper frequency response function, and no phase-shift.

The only problem is how to apply the filter in reverse. I would think that the implementation would depend on the circumstances. For example, if the filtering is being done digitally on a computer, it is trivial.


Dr. Stupid

Since I specified the filter as FIR, you can simply convolve it with itself, reversing axis for one (i.e. time reversal of one copy of the FIR). This will force the filter to be odd length (if original filter is 'n' long, for even or odd 'n', the final one will be 2n-1, always odd),and symmetric, ergo no phase shift and an integer sample delay.

(NB. Any time delay is in fact a phase shift of t*f, but that is equal to a pure delay. Phase shift in this case refers to the non-pure-delay component.)

But you were headed right down the road there... You just derailed.
 
JJ,

If f(t) is even, then there will be no phase shift, so we can simply apply the filter twice. Problem solved.

Wrong. An even filter that is not symmetric will have phase shift, and a delay component of N/2-.5 samples.

I see you are using a slightly different definition of "even" than I am. I have always understood the term even to mean that f(t) = f(-t), for all t, which implies that it is symmetric about t = 0.

Are you sure you don't have the terms "symmetric" and "even" mixed up? For example, a function for which f(t-a) = f(a-t) would be symmetric about t = a, but would not be even.

In both cases, it's the symmetry about the center that is the key to a constant-delay filter, notice.

Then we are in agreement. That is what I meant by even.

If we can somehow apply the filter backwards in time, then the function response function will be f(-t). The Fourier transform of f(-t) is the complex conjugate of the Fourier transform of f(t). This means that applying the filter, followed by the time-reversal of the filter, should give the proper frequency response function, and no phase-shift.

The only problem is how to apply the filter in reverse. I would think that the implementation would depend on the circumstances. For example, if the filtering is being done digitally on a computer, it is trivial.


Dr. Stupid
--------------------------------------------------------------------------------

Since I specified the filter as FIR, you can simply convolve it with itself, reversing axis for one (i.e. time reversal of one copy of the FIR). This will force the filter to be odd length (if original filter is 'n' long, for even or odd 'n', the final one will be 2n-1, always odd),and symmetric, ergo no phase shift and an integer sample delay.

Yes, that is clear. Likewise if the filtering is done in the frequency domain, you can simply take the norm of the complex transfer function, where the norm of a complex number is defined to be the product of itself and its complex conjugate. Like I said, if it is being done digitally on a computer, then it is trivial. I just wasn't sure you were not referring to some general condition, for example, a hardware filter. Although I guess, in principle, any hardware filter would have to be an IIR filter.

(NB. Any time delay is in fact a phase shift of t*f, but that is equal to a pure delay. Phase shift in this case refers to the non-pure-delay component.)

I see, once again the terminology screwed me up. My knowledge of these things comes from a purely mathematical approach, rather than an applied one. I have always referred to a time-delay as simply being a special case of a frequency dependant phase-shift.


Since this thread has already derailed from its original, somewhat pointless topic, perhaps I can derail it further with some practical questions which have real relevance to my own work. Maybe you can help me out.

I have recently had to rewrite all the filtering software we use here in our lab, because the software we were using is not only buggy, but poorly documented, so that we don't know exactly what it is doing. All of our filters are frequency domain, zero phase-shift, zero time-delay, Butterworth filters. There are two issues which have somewhat puzzled me.

1) Zero padding: Since the signals being filtered are not periodic, some wrap-around effects will be present. This problem is usually resolved by padding the end of the filtered signal with zeroes. For time domain filtering with an FIR filter, this is simple. The amount of padding needed is just 1/2 the total length of the FIR filter.

Any idea how to estimate the appropriate padding length for a frequency domain filter, other than the brute-force method of inverse Fourier transforming the frequency response function, and seeing how long it takes it to go to (effectively) zero?

2) Notches. We need to apply band-stop notches to our filters, in order to block artifacts at certain frequencies. Specifically, we need to remove the 50 Hz signal which corresponds to the power lines. This shows up as very strong delta-like peaks at 50Hz, 100Hz, and so on. We started off by combining Butterworth band-stop filters with our other filters, but we find that the signal is so singular, than we must make our band-stop much wider than the actual peak, in order to completely eliminate it.

I have constructed a new type of notch, which essentially takes the form f(w) = 1 - exp[-(1/x)^2], where x = 0 is the location of the notch. This seems to give a nice smooth notch, which can destroy any singular peak without being much wider than the peak. The question is, can you think of any potential problems using such a notch could present?

Thanks,

Dr. Stupid
 
Anytime you're ready Bill, just post your answers.
(if you choose to participate, that is)

I answered 4 questions in 1 day. So far, you have answered 0 questions in 3 days.
 
T'ai Chi said:
Anytime you're ready Bill, just post your answers.
(if you choose to participate, that is)

I answered 4 questions in 1 day. So far, you have answered 0 questions in 3 days.

Not interested in being kept busy by lists of questions, Whodini. It would further the idea that this was simply a p***ing contest between us. The questions on this thread were prompted by your proclaiming your degrees and demanding that others do the same. I have never claimed math or stat degrees. I am but a bouncer at a local strip club.
 
BillHoyt said:


Not interested in being kept busy by lists of questions, Whodini. It would further the idea that this was simply a p***ing contest between us. The questions on this thread were prompted by your proclaiming your degrees and demanding that others do the same. I have never claimed math or stat degrees. I am but a bouncer at a local strip club.

Waaaait a minute. It's OK for you to challenge people with a list of questions, but it's not OK for them to do the same to you?

So, in the future if someone responds to lists of questions with

"Not interested in being kept busy by lists of questions. It would further the idea that this was simply a p***ing contest between us."

that will be an acceptable answer?

Would this be a valid response from Tai in answer to your list of questions?
 
Sundog said:


Waaaait a minute. It's OK for you to challenge people with a list of questions, but it's not OK for them to do the same to you?

So, in the future if someone responds to lists of questions with

"Not interested in being kept busy by lists of questions. It would further the idea that this was simply a p***ing contest between us."

that will be an acceptable answer?

Would this be a valid response from Tai in answer to your list of questions?

Are you forgetting Randi's "rules of engagement," sundog?
 
BillHoyt said:


Are you forgetting Randi's "rules of engagement," sundog?

I don't play the respond-to-a-question-with-a-question game. It is noted that you refuse to answer these simple questions.
 
BillHoyt said:

Not interested in being kept busy by lists of questions,


Gee, now you know how I feel. :)


The questions on this thread were prompted by your proclaiming your degrees and demanding that others do the same. I have never claimed math or stat degrees. I am but a bouncer at a local strip club.

Well, I remain convinced that degrees are important. Thanks Bill. :)

If you tell me to burn my degrees, yet you know very little of statistics based on your non-responses, then I guess you are the one who doesn't know what they are talking about. Eh?
 
T'ai Chi said:


Gee, now you know how I feel. :)



Well, I remain convinced that degrees are important. Thanks Bill. :)

If you tell me to burn my degrees, yet you know very little of statistics based on your non-responses, then I guess you are the one who doesn't know what they are talking about. Eh? [/B]

Ah, yes, brilliant conclusion.
 
BillHoyt said:


Ah, yes, brilliant conclusion.

Point out the flaw in it.

Edited to add: Never mind, I should know by now that that way lies madness.
 
Sundog said:

Waaaait a minute. It's OK for you to challenge people with a list of questions, but it's not OK for them to do the same to you?


If Bill can critique others statistics knowledge so sharply, I'd hope that he has at least some statistics knowledge.

I don't think Bill can handle the Larsen List format. :)
 
T'ai Chi said:


If Bill can critique others statistics knowledge so sharply, I'd hope that he has at least some statistics knowledge.

I don't think Bill can handle the Larsen List format. :) [/B]

It's very satisfying, though, how this thread turned around 180 degrees to bite the biter back. I wish I could vote again on it.
 
BillHoyt said:
"Not interested in being kept busy by lists of questions, Whodini."

I am sorry to hear that. A number of the questions looked interesting and I was hoping to see a discussion. It does seem a little unfair here to pepper somebody with questions and then walk away when he does the same to you. We understand that you are a strip club bouncer, but still one would hope that you could take a little time off from that demanding career to answer a few statistics questions.

JamesM asked,

"This isn't really important, but I'm curious: was Sherlock Holmes another of Whodini's sockpuppets?"

BillHoyt seemed to think he was. If this is true I would be surprised. While both fellows occasionally seem strangely open to some pretty weird ideas, Sherlock Holmes seemed substantially different to me. SH often seemed unable to grasp what was being said to him. Whodini has struck me as brighter and it seems unlikely that somebody would put forth a character as dense as SH seemed to be if one didn't have to.

Any chance of an honest response to the above thought, T'ai Chi?
 
Stimpson J. Cat said:
JJ,



I see you are using a slightly different definition of "even" than I am. I have always understood the term even to mean that f(t) = f(-t), for all t, which implies that it is symmetric about t = 0.

Ahh. Ok. For FIR filters, the number of taps of length (talking in discrete-time here) turns out to be relevant to a number of things. An even-tap filter has a half-sample delay, which can be annoying or very useful, depending :) Because of the limit conditions at Pi and 0, one or the other may be much more useful in a given application.


Are you sure you don't have the terms "symmetric" and "even" mixed up? For example, a function for which f(t-a) = f(a-t) would be symmetric about t = a, but would not be even.

Even number of taps is what I mean. Symmetry means symmetry around the center point of the filter.

Yes, that is clear. Likewise if the filtering is done in the frequency domain, you can simply take the norm of the complex transfer function, where the norm of a complex number is defined to be the product of itself and its complex conjugate. Like I said, if it is being done digitally on a computer, then it is trivial. I just wasn't sure you were not referring to some general condition, for example, a hardware filter. Although I guess, in principle, any hardware filter would have to be an IIR filter.

Standard RCL filters are IIR by definition (best expressed in Laplace, not in Fourier or certainly not in 'z' domain :) )

However, there are SAW filters and CCD/Bucket Brigade FIR filters in "hardware". SAW can be continuous time, CCD obviously sampled, although at a quite high rate where Nyquist may not get terribly involved.

I see, once again the terminology screwed me up. My knowledge of these things comes from a purely mathematical approach, rather than an applied one. I have always referred to a time-delay as simply being a special case of a frequency dependant phase-shift.

Which is it. The "linear-phase" component is usually extracted from a filter as the "delay'.

I have recently had to rewrite all the filtering software we use here in our lab, because the software we were using is not only buggy, but poorly documented, so that we don't know exactly what it is doing. All of our filters are frequency domain, zero phase-shift, zero time-delay, Butterworth filters. There are two issues which have somewhat puzzled me.

Well, butterworth filters have phase shift. I'm assuming since you're talking about sampled data you're taking the magnitude response of the butterworth and using it at zero phase as a filter in a convolve via transform scheme?

Works, but you have a LOT of padding to do.

1) Zero padding: Since the signals being filtered are not periodic, some wrap-around effects will be present. This problem is usually resolved by padding the end of the filtered signal with zeroes. For time domain filtering with an FIR filter, this is simple. The amount of padding needed is just 1/2 the total length of the FIR filter.

The length you need is N+M-1. Not half, length - 1 of the FIR added to the signal. Some signal will be before zero time, then, too. That's just how it is.

Any idea how to estimate the appropriate padding length for a frequency domain filter, other than the brute-force method of inverse Fourier transforming the frequency response function, and seeing how long it takes it to go to (effectively) zero?

There is no simple answer. You need to figure out how long the impulse response that YOU CARE ABOUT is.

Better to custom-design an FIR of the right type.

2) Notches. We need to apply band-stop notches to our filters, in order to block artifacts at certain frequencies. Specifically, we need to remove the 50 Hz signal which corresponds to the power lines. This shows up as very strong delta-like peaks at 50Hz, 100Hz, and so on. We started off by combining Butterworth band-stop filters with our other filters, but we find that the signal is so singular, than we must make our band-stop much wider than the actual peak, in order to completely eliminate it.

I have constructed a new type of notch, which essentially takes the form f(w) = 1 - exp[-(1/x)^2], where x = 0 is the location of the notch. This seems to give a nice smooth notch, which can destroy any singular peak without being much wider than the peak. The question is, can you think of any potential problems using such a notch could present?

Thanks,

Dr. Stupid
Yeah, I can. How long is the impulse response?

It may be way way long...

Again, try using a custom-designed FIR. You have MATLAB handy?
 

Back
Top Bottom