Skip to content
Snippets Groups Projects
Commit 1ddf962b authored by Federico Lolli's avatar Federico Lolli
Browse files

[LowPass] refactored name variables in camelCase

parent 8d726762
No related branches found
No related tags found
1 merge request!224Draft: Sensor Fault Detection
...@@ -26,14 +26,14 @@ namespace Boardcore ...@@ -26,14 +26,14 @@ namespace Boardcore
{ {
// TODO: WARNING! initialized at 0 // TODO: WARNING! initialized at 0
LowPass::LowPass(float gain, float cutoff_freq, float lambda) LowPass::LowPass(float gain, float cutoffFreq, float lambda)
: gain(gain), cutoff_freq(cutoff_freq), lambda(lambda), output(0) : gain(gain), cutoffFreq(cutoffFreq), lambda(lambda), output(0)
{ {
} }
float LowPass::filter(float input) float LowPass::filter(float input)
{ {
output = lambda * output + (gain / cutoff_freq) * (1 - lambda) * input; output = lambda * output + (gain / cutoffFreq) * (1 - lambda) * input;
return output; return output;
} }
......
...@@ -32,12 +32,12 @@ public: ...@@ -32,12 +32,12 @@ public:
* @brief Construct a new Low Pass object * @brief Construct a new Low Pass object
* *
* @param gain The gain of the filter * @param gain The gain of the filter
* @param cutoff_freq The cutoff frequency of the filter * @param cutoffFreq The cutoff frequency of the filter
* @param lambda The lambda parameter of the filter * @param lambda The lambda parameter of the filter
* *
* @note WARNING: Initialize output at 0 at first * @note WARNING: Initialize output at 0 at first
*/ */
LowPass(float gain, float cutoff_freq, float lambda); LowPass(float gain, float cutoffFreq, float lambda);
/** /**
* @brief Filter the input * @brief Filter the input
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
float filter(float input); float filter(float input);
private: private:
float cutoff_freq; float cutoffFreq;
float lambda; float lambda;
float gain; float gain;
float output; float output;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment