Comments (2)
Starting with the general form of a second-order (low-pass) transfer function in the s-domain:
G(s) = k*wc^2 / (s^2 + 2 * d * wc * s + wc^2).
Where k = DC gain, d = damping coefficient, wc = cut-off frequency (rad/s).
Then, we can convert the s-domain transfer function to a differential equation (as 's' is the derivative operator), using y as the output variable, x as the input variable:
y'' + 2 * d * wc * y' + wc^2 * y = wc^2 * x.
Then, using the backward Euler method to discretise the differential equation (Ideally, one should use the Tustin transform, but for simplicity I chose to use the backward Euler method to convert from the continuous domain to the discrete domain.):
y' = (y[n] - y[n-1]) / T and y'' = (y[n] - 2 * y[n-1] + y[n-2]) / T^2.
Substituting and rearranging gives the following difference equation:
y[n] * (1 + 2 * d * wc * T + (wcT)^2) - 2 * y[n-1] * (1 + d * wc * T) + y[n-2] = k * (wcT)^2 * x[n].
This can then be directly implemented in code. Note that for the backward Euler method, a sufficiently small sampling time T (relative to the filter bandwidth) is needed to achieve a good frequency-domain fit between the continuous and discrete versions of the filter.
Let me know if that helps!
from hadesfcs.
Thank you for taking the tiem to explain this , much appreciated.
from hadesfcs.
Related Issues (10)
- About OSHWA Certification
- Regarding the firmware upload HOT 2
- UAV Model used in flight simulator HOT 3
- CMake as build system HOT 1
- Bug in Communication/UAVDataLink HOT 1
- H7 based micro variant? HOT 3
- 50 ohm impedance trace
- FIRWinSyncDesign, Filter data Exports Broken for some countries/systems
- Can it be applied in Quadcopter ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hadesfcs.