1004,West-CBD,No.139 Binhe Rd,Futian District,Shenzhen, China Post Code:518048
+86-18682200597
sales@szhaiwang.com
source:Industry News release time:2022-11-01 Hits: Popular:Infrared sensing module
When hardware support for circular buffers isn't available, you have to "fake" them. Also, since ANSI C has no construct to describe circular buffers, most C compilers can't generate code to use them, even if the target processor has them.
You can always implement a circular buffer by duplicating the logic of a circular buffer in software (and many have), but the overhead can be prohibitive; the circular-fake might take several instructions to implement, compared to just a single instruction to do the multiply-accumulate operation. Therefore you need to fake it.
Here are several basic techniques to fake circular buffers:
1. Split the calculation: You can split any FIR calculation into its "pre-wrap" and "post-wrap" parts. By splitting the calculation into these two parts, you essentially can do the circular logic only once, rather than once per tap. (See fir_double_z in FirAlgs.c above.)
2. Duplicate the delay line: For a FIR with N taps, use a delay line of size 2N. Copy each sample to its proper location, as well as at location-plus-N. Therefore, the FIR calculation's MAC loop can be done on a flat buffer of N points, starting anywhere within the first set of N points. The second set of N delayed samples provides the "wrap around" comparable to a true circular buffer. (See fir_double_z in FirAlgs.c above.)
3. Duplicate the coefficients: This is similar to the above, except that the duplication occurs in terms of the coefficients, not the delay line. Compared to the previous method, this has a calculation advantage of not having to store each incoming sample twice, and it also has a memory advantage when the same coefficient set will be used on multiple delay lines. (See fir_double_h in FirAlgs.c above.)
4. Use block processing: In block processing, you use a delay line which is a multiple of the number of taps. You therefore only have to move the data once per block to implement the delay-line mechanism. When the block size becomes "large", the overhead of a moving the delay line once per block becomes negligible.
Read recommendations:
The increasingly popular radio frequency energy harvesting technology
Probe type NTC temperature sensor
Popular Recommended Products
P916 Digital sensor
2021-12-09PIR500B Analog sensor
2021-12-09PIR Lens 8308-5
2021-12-09PIR Lens 8120
2021-12-09PIR Lens 8006-2
2021-12-09SMD CDS Sensor
2024-03-27PIR Lens 8005
2021-12-09PIR Lens 8225
2021-12-09Φ11mm size
2021-11-27PIR Lens 1500
2021-12-09BISS0001
2021-11-27Storage water heater ntc thermistor.Human motion sensing module wholesaler
2022-10-09What makes FIR filter digital quality better?
2022-10-28The role of the NTC thermostat
2022-05-21The Role of NTC Thermistors in Electric Warming Hand Treasures.metal cap Photoresistor
2023-08-15The Application of NTC Thermistors in Far Infrared Heaters.Pyroelectric infrared sensor lens
2023-09-04What are the NTC thermistor used in new energy vehicles?
2023-05-11The main function of the thermistor
2022-05-10Precautions for the use of NTC thermal protectors
2022-05-27Intelligent dispenser NTC temperature sensor
2023-02-14Production process of NTC thermistor
2022-11-23szhaiwang4@hotmail.com
+86-18682200597
sales@szhaiwang.com