# Should HPF be higher than expected frequency range and LPF lower?

#### JohnSnow16041992

Joined Jun 2, 2023
62
I am confused. In a pulse sensor which I am developing for small animals, where pulse signal can range between 5Hz and 8Hz, I am using an HPF of 5Hz and a LPF of 8Hz. The real signal is somewhere close to 5Hz so I thought maybe 5Hz was way too close a cutoff, and so I proceeded picking Bard's brain on whether I should make HPF cutoff lower. Bard has confused me further. Bard says make a HPF cutoff of 6Hz (1Hz higher than signal to block all DC signals) and a LPF cutoff of 4Hz (1 Hz lower than signal to prevent alliasing (I don't "completely" understand that term)). I told Bard I am using another 5Hz HPF in the end to prevent any DC slipping through, but bard insists its suggested way is the better way as a HPF or ac coupling in the end can severely attenuate the signal. I

#### BobTPH

Joined Jun 5, 2013
8,104
Perhaps Bard is confused.

Filters do not cut off all frequencies below or above their “cutoff” frequency. In fact, oat the cutoff frequency, it is only reduced to 71% of the input. (because that is the definition of cutoff frequency)

Where it goes from there depends on the order if the filter. A first order filter will be down to about 35% at half the cutoff frequency. Higher order filters cut more sharply.

To design a filter you need to know what you are trying to filter out (frequency and magnitude) and what is an acceptable magnitude after the filter.

#### JohnSnow16041992

Joined Jun 2, 2023
62
Perhaps Bard is confused.

Filters do not cut off all frequencies below or above their “cutoff” frequency. In fact, oat the cutoff frequency, it is only reduced to 71% of the input. (because that is the definition of cutoff frequency)

Where it goes from there depends on the order if the filter. A first order filter will be down to about 35% at half the cutoff frequency. Higher order filters cut more sharply.

To design a filter you need to know what you are trying to filter out (frequency and magnitude) and what is an acceptable magnitude after the filter.
So I am not wrong trying to keep the signal frequency between HPF and LPF cutoffs, in that order, right? I mean HPF lower than the expected frequency and LPF higher than the expected frequency. Why is Bard mentioning Alliacing?

#### ericgibbs

Joined Jan 29, 2010
18,232
Hi JS,
Do you have more information on the nature and type of these signals?
Anti-aliasing is a requirement if you are considering sampling the signals in some way.
E

#### JohnSnow16041992

Joined Jun 2, 2023
62
Hi JS,
Do you have more information on the nature and type of these signals?
Anti-aliasing is a requirement if you are considering sampling the signals in some way.
E
Hi Eric, I actually have no more info on the type of these signals as I couldn't find any sample on the net. All I know is the frequency range. This is going to be sampled with an FFT based program which would calculate the frequency of signal.

#### BobTPH

Joined Jun 5, 2013
8,104
Aliasing occurs at frequencies more than half the sampling frequency. It has nothing to do with the signal frequency, as long as it is lower than that.

Bard does not know what he is talking about. Don’t listen to him.

#### MrChips

Joined Oct 2, 2009
29,848
There is some confusion here.

LPF attenuates signals higher than the cut-off frequency.
Sampling theorem dictates that you must remove signals that are above one-half the sampling frequency.
For example, if your sampling frequency is 1000Hz, you need to set the LPF cut-off frequency to 500Hz or lower. (I can expand on this later if you wish.)

A 8Hz pulse signal is not limited to 8Hz. It could very well have frequencies above 500Hz. Hence the cut-off frequency is determine by the sampling frequency and the range of frequencies of interest in your signal.

The purpose of the HPF is to remove DC voltages. For your application, a HPF with a cut-off frequency of 0.1Hz is probably adequate.

#### JohnSnow16041992

Joined Jun 2, 2023
62
There is some confusion here.

LPF attenuates signals higher than the cut-off frequency.
Sampling theorem dictates that you must remove signals that are above one-half the sampling frequency.
For example, if your sampling frequency is 1000Hz, you need to set the LPF cut-off frequency to 500Hz or lower. (I can expand on this later if you wish.)

A 8Hz pulse signal is not limited to 8Hz. It could very well have frequencies above 500Hz. Hence the cut-off frequency is determine by the sampling frequency and the range of frequencies of interest in your signal.

The purpose of the HPF is to remove DC voltages. For your application, a HPF with a cut-off frequency of 0.1Hz is probably adequate.
If the LPF is set at a high cut off 500Hz, does a notch filter for 50 - 60Hz become absolutely necessary or is it avoidable? Even if a notch of the first order is put in place, it won't put it out completely.

Last edited:

#### MrChips

Joined Oct 2, 2009
29,848
Line frequency notch filter is only required if there is a problem with line frequency noise. There are other methods of eliminating external noise pickup.

#### Ian0

Joined Aug 7, 2020
8,946
It's sometimes more useful to think about what you want to get rid of, rather than what you want to keep.
For instance, if there's nothing causing you a problem between 1Hz and 5Hz, then there's no need to filter it out.

#### JohnSnow16041992

Joined Jun 2, 2023
62
Line frequency notch filter is only required if there is a problem with line frequency noise. There are other methods of eliminating external noise pickup.
What does line frequency noise look like?

#### WBahn

Joined Mar 31, 2012
29,510
I am confused. In a pulse sensor which I am developing for small animals, where pulse signal can range between 5Hz and 8Hz, I am using an HPF of 5Hz and a LPF of 8Hz. The real signal is somewhere close to 5Hz so I thought maybe 5Hz was way too close a cutoff, and so I proceeded picking Bard's brain on whether I should make HPF cutoff lower. Bard has confused me further. Bard says make a HPF cutoff of 6Hz (1Hz higher than signal to block all DC signals) and a LPF cutoff of 4Hz (1 Hz lower than signal to prevent alliasing (I don't "completely" understand that term)). I told Bard I am using another 5Hz HPF in the end to prevent any DC slipping through, but bard insists its suggested way is the better way as a HPF or ac coupling in the end can severely attenuate the signal. I
What kind of pulses are these? What does the 5 Hz and 8 Hz refer to? Is that the rate at which pulses are being generated? How are these being transmitted and picked up? At what point in the processing chain are you placing these filters?

What would likely give you the best information is if you can get either a capture of typical signals or a diagram of the power spectral density of the signal.

Most importantly, stop asking Bard or any other LLM questions to which you hope to receive any semblance of an accurate answer. All of these models simply string together words based on how likely each word was to follow various collections of words within a large set of examples it analyzed. It has no more awareness (considerably less, in fact, since it has zero awareness) of what it is spouting than if you walked up to someone and asked them what word probably follows the three words, "peanut butter and". Would you be at all surprised if they said "jelly"? Fundamentally, that's all these LLM's are doing and the result is that they produce very plausible sounding nonsense.

#### JohnSnow16041992

Joined Jun 2, 2023
62
So I am posting a new thread because I think this is a unique problem in itself. I have caught a curious phenomenon.

I am building a pulse sensor. The circuit is like this. Signal from photo transistor, goes to HPF (0.48Hz), goes to Buffer amplifier, goes to LPF (48Hz), goes to amplifier, goes to amplifier again, goes to AC coupling, goes through a diode into the microcontroller to be read.

Now the thing is, after some time of use, a curious noise develops. The base line shifts by something like 1.46 Volts varies. I thought this was DC noise but I was surprised how it could go through an AC coupling. I was using a 3.3uF Cap for AC coupling and thought it might be smart to put a larger cap and so tested the AC coupling with a 10uF cap instead. The only change it caused was that the noise came later, but it still came. And also, the signal started coming later. What is happening here? How to bring the baseline back to zero?

Below screenshot was taken little while after the signal source was removed. First the noise is jagged, then it stabilises.

#### Ian0

Joined Aug 7, 2020
8,946
I think we need a circuit diagram.

#### JohnSnow16041992

Joined Jun 2, 2023
62
I think we need a circuit diagram.
sort of a semi-circuit semi-block diagram below, drawing all the op amp connections would have been cumbersome but I assure you I did all the connections right, I can even see the pulse from my own finger clearly.
The only problem is this noise, when I remove my finger things should drop down to zero.

#### Ian0

Joined Aug 7, 2020
8,946
By drawing a block and labelling it LPF we assume that it is a fully functional low pass filter, and if it were, the scheme would function successfully.
Clearly, one of the blocks is not functioning as it should, and without a diagram for the what is in the block it is difficult to help.

By the way, is there a discharge path for the 3.3uF capacitor. If there isn’t that could be your problem.

#### JohnSnow16041992

Joined Jun 2, 2023
62
By drawing a block and labelling it LPF we assume that it is a fully functional low pass filter, and if it were, the scheme would function successfully.
Clearly, one of the blocks is not functioning as it should, and without a diagram for the what is in the block it is difficult to help.

By the way, is there a discharge path for the 3.3uF capacitor. If there isn’t that could be your problem.
You mean the 3.3uF just before the diode? I didn't know I needed a discharge path for it. How should it be? Do you want me to turn it into an HPF? Because I tried that with HPF 0.48 Hz and it doesn't get rid of the noise.

Last edited:

#### MrChips

Joined Oct 2, 2009
29,848
Try to understand what is DC.

Theoretically, DC refers to signal at 0Hz on the frequency spectrum. In practice, there is no such thing as DC. You would have to sample for infinite time in order to declare it is 0Hz. There could still be moving DC at 0.1Hz, 0.01Hz, 0.001Hz. There is no lower limit.

To calculate the HPF cut-off frequency, use the formula,

fc = 1 / (2πRC)

where fc = cut-off frequency, Hz

With R = 100kΩ and C = 3.3μ, fc = 0.5Hz

If you were to include the input impedance of the amplifier, the effective R would be lower, resulting in a higher cut-off frequency.
Hence, one can still expect to see "DC" fluctuations at 0.5Hz and above and below 0.5Hz.

#### JohnSnow16041992

Joined Jun 2, 2023
62
Ok, update. Noise also happens when I switch on a bulb in the room, like a sudden spike. This thing something to do with EMI?

#### MrChips

Joined Oct 2, 2009
29,848
Ok, update. Noise also happens when I switch on a bulb in the room, like a sudden spike. This thing something to do with EMI?
It is more likely power-line interference. This is very common and can be observed when the Curie temperature regulation on a soldering station switches on and off.