We are Apogeeweb Semiconductor Electronic

WELCOME TO OUR BLOG

Home arrow Filters arrow What is RC Low Pass Filter? Calculation and Applications

arrow left

arrow right

What is RC Low Pass Filter? Calculation and Applications

Author: Apogeeweb
Date: 18 May 2021
 1705
low pass filter calculation

Introduction

As everyone knows, in order to create a passive low pass filter, combing resistive elements with reactive elements happens often. Put simply, a typical circuit composed of resistors and capacitors or inductors. According to theories, the resistor–inductor (RL) low-pass topology is equivalent to the resistor-capacitor (RC) low-pass topology in terms of filtering capability. However. in fact, RC low pass filters are more common, so this article will focus on first-order RC low pass filters.

In this video, Passive RC Low Pass Filter has been discussed. 

Catalog

Introduction

Ⅰ Typical RC Circuit

1.1 Time Domain

1.2 Frequency Domain

Ⅱ First-order Low Pass Filter on Software

2.1 Basic Filtering Algorithm

2.2 Basic Algorithm of First-order RC Digital Filtering

Ⅲ Optimization Method- Filtering Coefficients Adjustment


Ⅰ Typical RC Circuit

The RC circuit has thousands of uses and is a very important circuit to study. Not only can it be used to time circuits, it can also be used to filter out unwanted frequencies in a circuit and used in power supplies, like the one for your computer, to help turn ac voltage to dc voltage.

Typical RC Circuit (DC, AC, and Pulse Signals can all use it)

Figure 1. Typical RC Circuit (DC, AC, and Pulse Signals can all use it)

1.1 Time Domain

Capacitor Current:

capacitor current
According to Kirchhoff’s Voltage Law:

voltage

Where, the unit of Ui is volts, the unit of RC is seconds, and τ=RC, get:

voltage formula

Suppose the initial voltage of the capacitor is 0, where:
R=1000Ω
C=4.7uF
Ui=1V
t=0.0001~0.1s
τ=RC
Vc(τ)=0.632 

Step Response Curve of a First-order RC System
Figure 2. Step Response Curve of a First-order RC System

1.2 Frequency Domain

Taking the capacitor voltage as the output, the network function of the circuit is:
rc low pass filter calculationWhere u1=Ui, u2=Uo
Let ωc be equal to:
rc low pass filter calculation, which is the cut-off frequency.

Amplitude and phase angle function:

rc low pass filter calculation

rc low pass filter calculation

Value of variables:
R=1000Ω
C=4.7uF 

rc low pass filter calculation

rc low pass filter calculation

rc low pass filter calculation

rc low pass filter calculation

|A(fc)|=0.707

rc low pass filter calculation

θ(fc)=-45, f=0.001, 1, …….100000.

Amplitude and phase frequency characteristics:

Amplitude and phase frequency characteristics

Figure 3.

Amplitude and phase frequency characteristics

Figure 4.

Logarithmic representation of amplitude-frequency characteristic:

Logarithmic representation of amplitude-frequency characteristic

Figure 5.

  • Analysis:

When ω<ωc, the amplitude is a straight line parallel to the coordinate, and there is no attenuation. 
When ω>ωc, it is a straight line whose slope is proportional to -20dB/decade.
When ω=ωc, the gain is attenuated to 0.707, which is -3dB, and the phase lags by 45 degrees, corresponding to a low-pass filter. This frequency is usually called the cutoff frequency.

 

  • Disadvantages:

When using this analog filter to suppress low-frequency interference, the filter is required to have a larger time constant and a high-precision RC network. Increasing the time constant requires increasing the value of R, and meanwhile, the leakage current increases accordingly, thereby reducing the filtering effect.

rc circuit

Figure 6. RC Circuit

Ⅱ First-order Low Pass Filter on Software

  • Advantages

1) The use of digital filtering algorithms to achieve dynamic RC filtering can well overcome the shortcomings of analog filters.
2) This kind of algorithm is more practical when the simulation constant is required.
3) It has a good inhibitory effect on periodic interference.
4) Save RAM space

 

  • Disadvantages

1) Exit phase lag, resulting in low sensitivity.
2) It cannot filter out interference with a frequency higher than half of the sampling frequency (called the Nyquist frequency. For example, if the sampling frequency is 100 Hz, it cannot filter out interference signals above 50Hz). In this case, an analog filter should be used.
3) For the single-chip microcomputer without multiplication and division running instructions, the workload of the program operation is relatively large.


2.1 Basic Filtering Algorithm

  • Origin of the Algorithm

The transfer function of the first-order RC low-pass filter in the S domain for frequency analysis:
Through z-transformation (there are many methods, such as first-order forward difference, bilinear transformation, etc. Here, the first-order backward difference method is used):

 

  • Into the S-domain Transfer Function

 

After the derivation is transformed into the difference equation, we can get:

The transfer function in the S domain can be transformed into a difference equation in the time domain through the Z transformation.

2.2 Basic Algorithm of First-order RC Digital Filtering

X is the input, Y is the output value after filtering, then: a is a parameter related to the RC value, called the filter coefficient, its value determines the weight of the new sample value in the filtering result of this time, and its value is usually far less than 1, when the sampling interval t is small enough:


1) The smaller the filtering coefficient, the smoother the filtering result, but the lower the sensitivity.
2) The larger the filtering coefficient, the higher the sensitivity, but the more unstable the filtering result.
3) The output value this time mainly depends on the last filtered output value, and the current sampled value has a relatively small effect on this output, which plays a corrective role.
4) Cutoff frequency

For example: t=0.5s (f=2Hz), a=1/32
where fl=(1/32)/(2*3.14*0.5)=0.01Hz

 

  • Basic Program

Write the program according to the basic principles and formulas of first-order filter, as follows:
/*In the program, integer arithmetic is faster than decimal arithmetic. In order to speed up the processing speed of the program, for calculation convenience, a is an integer (from 0~255), 1-a is replaced by 256-a, which means that the new sample value is being filtered. The weight in the result (you can also change the base of 1-a to 100-a, and the calculation result will be processed accordingly)*/

#define a 128 

char value; //Last filtering value
char filter()
{
    char new_value;
    new_value=get_ad();//Sampling value
    return(256-a)*value/256+a*new_value/256;
}

  • Initial Optimization of the Program

Reduce the number of operations of multiplication and division to increase the speed of operations.
Specific optimization methods:
First compare the new sampled value with the previous filtering result, and then use different formula calculations based on the comparison, so that the calculation efficiency of the program is doubled.
Resolve the basic formula to get:

 

  • Process

First-order Low Pass Filter Program Process

Notes:
S → New Sampling Value
R → Previous Filtering Result
C→ Filter Coefficient
N→ New Filtering Result

 

  • Program

/*Int: NEW_DATA     New sampling values
       OLD_DATA       Last filtering result
       k        Filter coefficient (0~255)
  Out:         The filtering results
 */
 char filter_1(char NEW_DATA,char OLD_DATA,char k)
{
    int result;
    if(NEW_DATA<OLD_DATA)
    {
        result=OLD_DATA-NEW_DATA;
        result=result*k;
        result=result+128;//+128 Round Up
        result=result/256;
        result=OLD_DATA-result;
    }
    else if(NEW_DATA>OLD_DATA)
    {
        result=NEW_DATA-OLD_DATA;
        result=result*k;
        result=result+128;//+128 Round Up
        result=result/256;
        result=OLD_DATA-result;
    }
    else result=OLD_DATA;
    return((char)result);
}

 

  • Filtering Analysis

When the filtering coefficient is 30:

filtering result

Figure 7.

When the filtering coefficient is 128:

filtering result

Figure 8.

When the filtering coefficient is 200:

filtering result

Figure 9.

It can be seen that the smaller the filtering coefficient, the smoother the filtering result, but the lower the sensitivity. On the contrary, the larger the filtering coefficient, the higher the sensitivity, but the more unstable the filtering result.

  • Insufficient

1) The contradiction between sensitivity and smoothness
2) Errors caused by discarding decimals.
For example: the current sampling value=25, the last filtering result=24, and the filtering coefficient=10;
According to the algorithm, the filtering result of this time = 24.0390625
In single-chip microcomputers, floating-point numbers are rarely used, and the fractional part is either discarded or needs to round up. In this way, the result is 24. If the sampling value is always 25, the result will always be 24. Because the filtering result and the actual data will always have an error that cannot be eliminated. Sometimes it will cause the filtering result curve to deviate from the actual value when the sampling data is stable at a certain value (that is, there is a large error between the filtering result and the actual result although in a stable case).

 

  • Be Careful

1) Changing the filtering coefficient, increasing it will reduce the smoothness, and if it is too large, the filtering will lose its meaning.
2) The use of decimal part in calculations will bring heavy computational pressure to the CPU.

 

Ⅲ Optimization Method- Filtering Coefficients Adjustment

  • Realize the Function

1) When the data changes rapidly, the filtering results can be followed up in time, and the faster the data changes, the higher the sensitivity should be (sensitivity priority principle).
2) When the data becomes stable and oscillates within a range, the filtering result can become stable (the principle of stability first).
3) When the data is stable, the filtering result can be approximated and finally equal to the sampling data (eliminate the error caused by decimals in the calculation).

 

  • Judgment before Adjustment

1) Whether the data changes consistently. For example, when the two consecutive sampling values are larger than the previous filtering result, it is normal, otherwise it is regarded as inconsistent.
2) Whether the data changes quickly, which is to judge the difference between the sampling value and the previous filtering result.
Adjustment Principle
1) When the two data changes are inconsistent, it means there is jitter. Clear the filtering coefficient to zero, and delete the new sampling value.
2) When the data changes consistently, gradually increase the filtering coefficient to provide the weight of this sampling.
3) When the data changes quickly (difference value> debounce count acceleration response threshold), the filtering coefficient should be increased quickly.

 

  • Adjusting Filter Coefficient Process


① Calculate the difference (absolute value) between the current sampling value and the last filtering result; Set the data change direction flag.
② Two changes in the same direction?
③ First order filter coefficient + coefficient increment (the maximum value is taken when the result is greater than the maximum value).

 

  • Several Constant Parameters and Their Ranges

1. Debounce counting acceleration response threshold is determined according to the actual situation.
2. The maximum value of debounce count, which is generally 10.
3. The increment of filtering coefficient range is 10~30.
4. The maximum value of the filtering coefficient is generally 255.
Before starting the first-order filtering program, open the adjustment filter coefficient program to adjust the coefficients in real time.

 

  • Filtering Effect

1. When the sampled data is accidentally interfered, the interference in the filtering result is completely filtered out.
2. When the data oscillates within a range, the filtering result curve is very smooth, almost a straight line.
3. When the sampling data has real changes, the filtering results can be followed up in a relatively timely manner.
4. When the sampling data becomes stable, the filtering result gradually approaches and is finally equal to it.

Finally, improve the algorithm. Taking into account the requirements of sensitivity and stability; and meanwhile, it does not consume too much RAM space. As long as a few constants are adjusted reasonably, the algorithm is more suitable for practical applications.

 

Frequently Asked Questions about RC Low Pass Filter

1. What is RC low pass filter?
A low pass filter is a filter which passes low-frequency signals and blocks, or impedes, high-frequency signals. ... Low pass filters can be constructed using resistors with either capacitors or inductors. A low pass filter composed of a resistor and a capacitor is called a low pass RC filter.

 

2. Why RC circuit is low pass filter?
Then by carefully selecting the correct resistor-capacitor combination, we can create a RC circuit that allows a range of frequencies below a certain value to pass through the circuit unaffected while any frequencies applied to the circuit above this cut-off point to be attenuated, creating what is commonly called a rc low pass fiter.

 

3. What is difference between RC low pass filter and RC high pass filter?
Low pass filter is the type of frequency domain filter that is used for smoothing the image. It attenuates the high frequency components and preserves the low frequency components. High pass filter: ... It attenuates the low frequency components and preserves the high frequency components.

 

4. What is the transfer function of a low pass filter?
Low Pass Filters and their Transfer Functions
As its name implies, a low pass filter is an electronic device that allows low frequency AC signals to pass a current through the filter circuit. The output from the filter circuit will be attenuated, depending on the frequency of the input signal.

 

5. How is low pass filter frequency calculated?
The cut-off frequency or -3dB point, can be found using the standard formula, ƒc = 1/(2πRC). The phase angle of the output signal at ƒc and is -45o for a Low Pass Filter.

Best Sales of diode

Photo Part Company Description Pricing (USD)
CP2725AC54TEZ CP2725AC54TEZ Company:ABB Power Electronics Inc. Remark:AC/DC CONVERTER 54V 5V 2725W Price:
1+: $671.60000
5+: $649.93600
10+: $628.27100
25+: $606.60600
50+: $584.94160
100+: $576.27570
Inquiry
ACS724KMATR-30AU-T ACS724KMATR-30AU-T Company:Allegro MicroSystems Remark:SENSOR CURRENT HALL 30A DC Price:
3000+: $2.39680
Inquiry
AM29F800BB-90ED AM29F800BB-90ED Company:AMD Remark:Flash, 512KX16, 90ns, PDSO48, Price:
Call
Inquiry
AM29LV040B-120JI AM29LV040B-120JI Company:AMD Remark:Flash, 512KX8, 120ns, PQCC32, PLASTIC, LCC-32 Price:
Call
Inquiry
10104110-0001LF 10104110-0001LF Company:Amphenol ICC (FCI) Remark:CONN RCPT USB2.0 MICRO B SMD R/A Price:
1000+: $0.40260
2000+: $0.39040
3000+: $0.36600
5000+: $0.35380
10000+: $0.32940
25000+: $0.31720
Inquiry
10131318-0611100LF Company:Amphenol ICC (FCI) Remark:CONN HEADER R/A 6POS 4.2MM Price:
1+: $1.02000
10+: $0.89700
100+: $0.77350
500+: $0.63288
1000+: $0.56256
5000+: $0.49224
10000+: $0.46763
Inquiry

Alternative Models

Part Compare Manufacturers Category Description
Mfr.Part#:CC0201KRX7R7BB332 Compare: 0201B332K160CT VS CC0201KRX7R7BB332 Manufacturers:Yageo Category:Ceramic Capacitors Description: 0201 3.3nF ±10% 16V X7R
Mfr.Part#:0201X103K6R3CT Compare: Current Part Manufacturers:Walsin Technology Category: Description: 0201 10nF ±10% 6.3V X5R
Mfr.Part#:GRM033R60J103KA01D Compare: 0201X103K6R3CT VS GRM033R60J103KA01D Manufacturers:muRata Category:Ceramic Capacitors Description: 0201 10nF ±10% 6.3V X5R
Mfr.Part#:CC0201KRX5R5BB103 Compare: 0201X103K6R3CT VS CC0201KRX5R5BB103 Manufacturers:Yageo Category:Ceramic Capacitors Description: 0201 10nF ±10% 6.3V X5R

Ordering & Quality

Image Mfr. Part # Company Description Package PDF Qty Pricing (USD)
67997-206HLF 67997-206HLF Company:Amphenol ICC (FCI) Remark:CONN HEADER VERT 6POS 2.54MM Package:100
DataSheet
In Stock:12060
Inquiry
Price:
1+: $0.33000
10+: $0.31600
100+: $0.22120
500+: $0.18964
1000+: $0.15803
5000+: $0.13545
10000+: $0.12642
Inquiry
ADSP-21062LKSZ-160 ADSP-21062LKSZ-160 Company:Analog Devices Inc. Remark:IC DSP CONTROLLER 2MBIT 240MQFP Package:240-BFQFP Exposed Pad
DataSheet
In Stock:3
Inquiry
Price:
1+: $224.34000
Inquiry
ADSP-BF504BCPZ-3F ADSP-BF504BCPZ-3F Company:Analog Devices Inc. Remark:IC CCD SIGNAL PROCESSOR 88LFCSP Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
Call
Inquiry
AD8361ARMZ AD8361ARMZ Company:Analog Devices Inc. Remark:IC RF DETECT 2.5GHZ 8MSOP Package:8-TSSOP, 8-MSOP (0.118", 3.00mm Width)
DataSheet
In Stock:2498
Inquiry
Price:
1+: $9.04000
10+: $8.17000
25+: $7.79000
100+: $6.76400
250+: $6.46000
500+: $5.89000
Inquiry
AD8625ARZ-REEL7 AD8625ARZ-REEL7 Company:Analog Devices Inc. Remark:IC OPAMP JFET 4 CIRCUIT 14SOIC Package:14-SOIC (0.154", 3.90mm Width)
DataSheet
In Stock:1000
Inquiry
Price:
1000+: $6.27850
Inquiry
AD8638ARZ-REEL7 AD8638ARZ-REEL7 Company:Analog Devices Inc. Remark:IC OPAMP ZERO-DRIFT 1 CIRC 8SOIC Package:8-SOIC (0.154", 3.90mm Width)
DataSheet
In Stock:1000
Inquiry
Price:
1000+: $1.60950
Inquiry
ADAU1761BCPZ ADAU1761BCPZ Company:Analog Devices Inc. Remark:IC SIGMADSP CODEC PLL 32LFCSP Package:32-VFQFN Exposed Pad, CSP
DataSheet
In Stock:787
Inquiry
Price:
Call
Inquiry
ADIS16209CCCZ ADIS16209CCCZ Company:Analog Devices Inc. Remark:IMU ACCEL/INCLINE SPI 16LGA Package:16-LGA
DataSheet
In Stock:1535
Inquiry
Price:
1+: $65.82000
10+: $61.83000
25+: $59.83520
Inquiry

Related Articles

pinglun 0 comment

Leave a Reply

Your email address will not be published.

 
 
   
 
code image
Rating: poor fair good very good excellent

# 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z