By using this website, you agree to the use of cookies. We use them to optimize functionality and convenience of the site for our clients.
agreed
Click to order
Ваш заказ
Total:
Фамилия
Имя
Email
Ваш телефон
Доставка
Точную стоимость доставки уточнит оператор после оформления заказа
Нажимая на эту кнопку, вы даете согласие на обработку персональных данных и соглашаетесь c политикой конфиденциальности. Elemyo | 12 March 2020

# Digital notch (band-stop) noise filter 50/60 Hz.

The main reason causes a decrease in the accuracy of measurements of low-frequency signal parameters (including EMG / ECG / EEG signals) in laboratory, industrial and field conditions is the 50/60 Hz network interference.

Elemyo sensors provide the highest possible common mode rejection ratio, which allows the sensors to be used in very strong 50/60 Hz environments. Unfortunately, in some conditions, interference still appears in the signal. Examples of these conditions: touching the body of electrical equipment, power wires, working in a room with a very strong network load, individual skin parameters that affect the sensor contact. To suppress noise in such cases, it is proposed to use a 50/60 Hz notch filter. Below is a mathematical description of the filter, as well as an example of its implementation in the Arduino IDE.

You can find Elemyo library for Arduino here.
The content of the article:
2
Implementation
Go to the section
3
Filter Examples
Go to the section

1
Theory
The notch filter example below is taken from Digital Signal Processing (Third Edition). Authors: LizheTan, JeanJiang. (2019).

Filter Transfer Function: The scale factor for tuning the bandpass filter to a single gain of the passband is defined as: The difference equation describing the considered IIR filter has the following form: where x(n) is the last measurement of the signal, and x(n-1) and x(n-2) are the two previous measurements, y (n) is the current filtered value of the signal, and y (n-1) and y (n -2) - two previous values of the filtered signal. Fig. 1: Frequency response of the filter
(Signal sampling frequency 500 Hz, notch frequency 50 Hz, notch window 46-54 Hz).

2
Implementation
notch filter described in paragraph 1. implemented in the «ELEMYO.h» library for Arduino. The function for filtering is a method of the ELEMYO class and has the following form:
``````
int ELEMYO::BandStop (int sensorValue, int f, int BW)
{
//Calculation of time since the previous call
short DT = micros()-T;

//New countdown
T = micros();

//-----Calculation of filter coefficients-------------------
float r = 1 - 0.00000314*BW*DT;
float b1 = -2*cos(0.000006283*f*DT);
float a1 = r*b1;
float K = (1+a1+r*r)/(2+b1);
//------------------------------------------------------------------------

//The new signal value after filtering
Y=K*(sensorValue+b1*X+X)-a1*Y-r*r*Y;

//----Saving Values x(n-1), x(n-2), y(n-1), y(n-2)
Y=Y;
Y=Y;
X=X;
X=sensorValue;
//--------------------------------------------------------------------

return (int) Y;
}
``````
Here sensorValue is the current value of the filtered signal, f is the filter frequency (for 50 Hz, f = 50; for 60 Hz, f = 60), BW is the filter rejection window. The function returns a filtered value at the output.

The function body automatically calculates the frequency of reading the signal fs. For a function to work correctly, it is important that after reading the signal, it is immediately substituted into this function. You can perform signal readings with automatic filtering using the BandStop command (analogRead(…), 50, 4).
How the function works:
1. When a function is called, the first step is the calculation of the time interval in microseconds that has passed since the previous call and determines fs.

2. The second step is the calculation of the coefficients, according to the formulas in paragraph 1.

3. The current filtered value of the signal y is calculated.

4. The values x (n-1), x (n-2), y (n-1), y (n-2) are stored, which will be used on the next function call.

3
Filter examples
In fig. Figure 2 shows an example of an EMG signal that is very noisy by network interference. From the signal spectrum in Fig. Figure 5 shows that the interference frequency is 50 Hz and there are no other sources of interference. In fig. 3 shows a real-time filtered function described above. Fig. 2: Signal, very noisy by network interference. Fig. 3: The result of filtering the signal shown in Fig. 2. Fig. 4: Raw and filtered signals received in real time. Fig. 5: Spectrum of the signal shown in fig. 2. Fig. 6: Spectrum of the filtered signal (Fig. 3).
From the graphs in Fig. 5 and fig. Figure 6 shows that the network interference is suppressed more than 14 times. The above notch filter is a good solution to eliminate network interference, in case of its occurrence.
{"ft_lang_label":"__label__en","ft_lang_prob":0.91156375,"math_prob":0.92696255,"size":883,"snap":"2023-40-2023-50","text_gpt3_token_len":177,"char_repetition_ratio":0.096700795,"word_repetition_ratio":0.0,"special_character_ratio":0.2015855,"punctuation_ratio":0.10625,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99307907,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],"im_url_duplicate_count":[null,6,null,4,null,4,null,4,null,4,null,4,null,4,null,4,null,4,null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-28T23:18:11Z\",\"WARC-Record-ID\":\"<urn:uuid:85057902-10f3-4adf-82a9-e75502646d48>\",\"Content-Length\":\"81713\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:990d30e1-d395-4860-b8f5-3b26acf1ad57>\",\"WARC-Concurrent-To\":\"<urn:uuid:fd8c5724-1a54-4784-bfa7-cf2b6d6a9046>\",\"WARC-IP-Address\":\"185.215.4.28\",\"WARC-Target-URI\":\"https://www.elemyo.com/support/start_info/bandstop\",\"WARC-Payload-Digest\":\"sha1:2WZOLIYC6KWNFJJES7TR24PLP3M4G7JB\",\"WARC-Block-Digest\":\"sha1:TG6DTX7QLCDAC27ALR5NRV7WP6HOGHEM\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510462.75_warc_CC-MAIN-20230928230810-20230929020810-00171.warc.gz\"}"}