Makoiri uye op amps anotendera iwe kuti ugadzire anonakidza maseketi, senge anozivikanwa frequency mafirita. Aya mafirita ane huwandu hwekushandisa muindasitiri yemagetsi. Sezvazviri nenyaya yepasi pasi firita, iyo yepamusoro yekupfuura firita, nezvimwe. Ivo vanonyanya kufadza kune mamwe manyorerwo ekushandisa, kugona kusefa ruzha, kana zvimwe kana zvishoma kana zvakadzama ruzha zvinoenderana nekuwanda kwavo. Naizvozvo, ivo vanobatsira kwazvo.
Kana iwe uchida kuziva zvakawanda nezve yakaderera pasa firita, uye mamwe mafirita, uye nemabatiro avanogona kuita iwe muzvirongwa zvako naArduino kana DIY, ndinokukurudzira kuti urambe uchiverenga ...
Mafirita emagetsi
Seizvo zita rayo rinoratidzira, firita idunhu rinoumbwa nhevedzano yema coil uye ma capacitors, uye kunyangwe mamwe ekuwedzera anoshanda, nechinangwa che kurega zvimwe zvikamu zve frequency zvichipfuura. Ndokunge, yeiyo yakazara masekisheni enzvimbo dzinowanikwa, vanozosefa chimwe kana zvimwe zvikamu kuti zvidzivirire kuti vapfuure nepakati.
Kana zvirizvo ejemplo Tiri kutaura pamusoro pechiratidziro chinonzwika nemunhu, icho chinobva kubva pa20 Hz kusvika pa20 Khz, uine mafirita iwe aunogona kubvisa yakaderera, kana yepamusoro, kuitira kuti ungobvumidza iwo mashoma kana mashoma treble / mabhesi kurira. Icho chinhu chinoshandiswa nemazhinji marekodhi ekurekodha kana masisitimu ekuberekesa, senge mamaikorofoni, maspika, nezvimwe.
Mhando
Maererano ne firita mhando, kana zvirinani, zvinoenderana nekuwanda kwavanovharira kana iyo yavanobvumidza kuburikidza, pane akasiyana marudzi emacircuit ari:
- Yakadzika pasa firita: ivo vanodanwa kudaro nekuti iwo mafirita ayo anotendera iwo madiki ezasi kupfuura uye kudzvinyirira kana kudzikisira kupasa kwenzvimbo dzakakwirira. Iwo anosanganisira imwe kana anopfuura makoiri (mune akateedzana nemagetsi emagetsi uye mutoro), uye imwe kana maviri shunt capacitors ane magetsi emagetsi uye mutoro. Rangarira kuti mutoro unonzwisiswa sechigadzirwa chakabatana nefirita uye chinotora chinoburitsa firita ... Mukati meaya mafirita kune zvimwewo zvakasiyana π.
- Yakakwirira yekupfuura firita: iyo yepamusoro yekupfuura firita yakapesana neyepasi pasi, mune ino kesi, icho chichaisefa kana kudzikisira ndiyo yakaderera frequency pass, ichirega iwo akakwirira mafambiro kupfuura. Mune izvi zvinhu zvemagetsi zvinoumba zvakaiswa. Ndokunge, pano iwo ma capacitors anozove iwo akateedzana pamwe nemagetsi uye nemutoro, nepo iwo machira achadzimwa. Iko kune zvakare mamwe madiki madiki senge ari mune akadzika ekupasa mafirita.
- Bhendi pfuura firita: Rudzi rwefaira runoshandisa maviri frequency band pass rate block. Ndokunge, vanoita zvese seyepasi yekupepeta firita uye seyepamusoro yekupfuura firita, vachipokana nekufamba kwenzvimbo dzakaderera uye zvakare dzakakwirira panguva imwe chete. Mune mamwe mazwi, zvinongobvumira iwo epakati mafambiro ekupfuura.
- Bhendi firita: zvakanyatsopesana neiyo yapfuura, zvazvinoita ndezvekuti zvinosefa kupfuura kwepakati pezviyero uye zvinongorega kuburikidza neakaderera uye epamusoro mafambiro.
Rangarira izvozvo inductions ivo vanorega kuburikidza neakaderera frequency uye vanopokana kupfuura kwenzvimbo dzakakwirira. Asi, capacitors vanorega kuburikidza nehurefu hwakakwira uye vanopokana nekufamba kwenzvimbo dzakaderera.
Ndinoda kuwedzera mafirita aya padanho rinoshanda havana kukwana, uye ivo vanogona nguva dzose kurega kuburikidza nedzimwe dzakaderera kana dzakakwira mafambiro aunofanira kuvharira. Nekudaro, ivo vanoita basa ravo zvakanaka kwazvo kune akawanda mafomu.
Uye pakupedzisira, ini ndinodawo kujekesa chimwe chinhu, uye ndezvekuti iwe wakanyatsonzwa nezve iyo EMA uye DEMA mafirita. EMA (Exponential Moving Avhareji) mafirita anotendera kushandisa iyi mhando yefaira munzira yakapusa mumidziyo yakadzika. Kana iri DEMA (Double Exponential Moving Avhareji), vane mhinduro nekukurumidza kupfuura EMA, kuchengetedza kudzvinyirira kwakanaka kweruzha iwe rwaunoda kudzivirira.
Alpha chinhu
El alpha chinhu, iyo iwe yauchazoona iyo inowanikwa muArduino IDE makodhi muchikamu chinotevera, ndiyo paramende iyo inogadzirisa maitiro eiyo exponential firita. Izvo zvine chekuita neye cutoff frequency:
- Alpha = 1: iyo inopa chiratidzo kune isina kufiridzwa kuburitsa.
- Alpha = 0: iyo firita kukosha ichagara iri 0.
- Alpha = x: mamwe maitiro anogona kuwana kumwe kuchinjika muEMA firita. Kana iwe ukadzora iyo Alpha chinhu, iwe unozopfavisa iyo frequency chiratidzo inowanikwa yakawanda, uye nguva yekupindura yeiyo system inowedzerwawo (zvinotora nguva yakareba kudzikamisa).
Mafirita uye Arduino
Iwe unofanirwa kuziva kuti hazvidi kuti ugadzire dunhu firita yepamusoro kana firita yepasi yakaderera kuti ubatanidze kune yako Arduino bhodhi uye shanda nayo. Kunyangwe iwe uchikwanisa kuyedza uye kugadzira aya marudzi easina nyore mafirita, iwe unogona zvakare kuyedza kuti EMA ingashanda sei neiyo chete Arduino bhodhi uye yakapusa kodhi yeArduino IDE. Ndicho chinhu chega chaunoda kuti uone kuti chiri kuita sei kusefa mamwe mafrifits (mune ino chiitiko chiito chakafananidzwa uye mamwe manhamba / kuyangarara zvinongo svinurwa kutevedzera zvandaizoita Sefa chaizvo).
Heano mamwe emakodhi sampuli aunogona kushandisa kudzidzira.
Semuenzaniso weyakareruka dijitari firita muArduino yerudzi pasi pasi:
float lowpass_prev_out[LOWPASS_ANALOG_PIN_AMT], lowpass_cur_out[LOWPASS_ANALOG_PIN_AMT]; int lowpass_input[LOWPASS_ANALOG_PIN_AMT]; int adcsample_and_lowpass(int pin, int sample_rate, int samples, float alpha, char use_previous) { // pin: Pin analógico de Arduino usado // sample_rate: El ratio adecuado // samples: Samples // alpha: El factor Alpha para el filtro paso bajo // use_previous: Si es true se sigue ajustando hasta el valor más reciente. float one_minus_alpha = 1.0-alpha; int micro_delay=max(100, (1000000/sample_rate) - 160); if (!use_previous) { lowpass_input[pin] = analogRead(pin); lowpass_prev_out[pin]=lowpass_input[pin]; } int i; for (i=samples;i>0;i--) { delayMicroseconds(micro_delay); lowpass_input[pin] = analogRead(pin); lowpass_cur_out[pin] = alpha*lowpass_input[pin] + one_minus_alpha*lowpass_prev_out[pin]; lowpass_prev_out[pin]=lowpass_cur_out[pin]; } return lowpass_cur_out[pin]; } int resulting_value; void setup() { Serial.begin(9600); resulting_value = adcsample_and_lowpass(0, 1000, 300, 0.015, false); } void loop() { resulting_value = adcsample_and_lowpass(0, 1000, 150, 0.015, true); Serial.println(resulting_value);
Code kodhi yemhando yeArduino Kupfuura kwepamusoro:
int sensorPin = 0; //pin usado para el ADC int sensorValue = 0; //Inicia sensor variable equivalente a EMA Y float EMA_a = 0.3; //Inicialización del EMA Alpha int EMA_S = 0; //Iniciación del EMA s int highpass = 0; void setup(){ Serial.begin(115200); EMA_S = analogRead(sensorPin); } void loop(){ sensorValue = analogRead(sensorPin); //Lee el valor del sensor ADC EMA_S = (EMA_a*sensorValue) + ((1-EMA_a)*EMA_S); //Ejecuta el filtro EMA highpass = sensorValue - EMA_S; //Calcula la seña alta Serial.println(highpass); delay(20); //Espera 20ms }
Arduino kodhi muenzaniso bhendi kupfuura:
int sensorPin = 0; //Pin para el ADC int sensorValue = 0; //Inicia la variable del sensor, equivale a EMA Y float EMA_a_low = 0.3; //Inicia EMA Alpha float EMA_a_high = 0.5; int EMA_S_low = 0; //Inicia EMA S int EMA_S_high = 0; int highpass = 0; int bandpass = 0; void setup(){ Serial.begin(115200); EMA_S_low = analogRead(sensorPin); EMA_S_high = analogRead(sensorPin); } void loop(){ sensorValue = analogRead(sensorPin); //Lee el valor del sensor ADC EMA_S_low = (EMA_a_low*sensorValue) + ((1-EMA_a_low)*EMA_S_low); //Ejecuta EMA EMA_S_high = (EMA_a_high*sensorValue) + ((1-EMA_a_high)*EMA_S_high); highpass = sensorValue - EMA_S_low; bandpass = EMA_S_high - EMA_S_low; Serial.print(highpass); Serial.print(" "); Serial.println(bandpass); delay(20); }
Arduino kodhi muenzaniso kwechikwata:
int sensorPin = 0; //Pin usado para el ADC int sensorValue = 0; //Inicio para EMA Y float EMA_a_low = 0.05; //Inicio de EMA alpha float EMA_a_high = 0.4; int EMA_S_low = 0; //Inicia EMA S int EMA_S_high = 0; int highpass = 0; int bandpass = 0; int bandstop = 0; void setup(){ Serial.begin(115200); EMA_S_low = analogRead(sensorPin); EMA_S_high = analogRead(sensorPin); } void loop(){ sensorValue = analogRead(sensorPin); //Lee el valor del sensor ADC EMA_S_low = (EMA_a_low*sensorValue) + ((1-EMA_a_low)*EMA_S_low); //Ejecuta EMA EMA_S_high = (EMA_a_high*sensorValue) + ((1-EMA_a_high)*EMA_S_high); bandpass = EMA_S_high - EMA_S_low; bandstop = sensorValue - bandpass; Serial.print(sensorValue); Serial.print(" "); Serial.print(EMA_S_low); Serial.print(" "); Serial.println(bandstop); delay(20); }
Ini ndinokukurudzira kuti uchinje uye kuyedza aya makodhi. Mhedzisiro iwe unogona ona zvakajeka kwazvo Kutenda kuSiriyeri Plotter yeArduino IDE… Rangarira kuti kana uine mibvunzo nezve Arduino chirongwa kana mashandisiro eDIE, unogona kurodha pasi yemahara HwLibre kosi muPDF.