-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDelay.cpp
More file actions
39 lines (33 loc) · 965 Bytes
/
Delay.cpp
File metadata and controls
39 lines (33 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
QDOB - Quasiperiodic Disturbance Observer
@author: Hisayoshi Muramatsu
@date: 2025.06.20
The QDOB has been published in the following paper.
---
Hisayoshi Muramatsu,
“Quasiperiodic Disturbance Observer for Wideband Harmonic Suppression,”
IEEE Transactions on Control Systems Technology, Early Access, 2025.
DOI:10.1109/TCST.2025.3566560
(https://ieeexplore.ieee.org/document/11006295)
---
If you intend to modify the QDOB algorithm, it is highly recommended to read the above paper.
Note that modifying the controller in the discrete-time domain can be challenging.
*/
#include "Delay.hpp"
Delay::Delay(
int Lmax
):Lmax(Lmax), count(0), Buff(Lmax){}
double Delay::Memory(const double& x, const int& L){
int num = count+L;
if(num<0) num += Lmax;
if(L==0){
return x;
}else{
return Buff[num];
}
}
void Delay::Update(const double& x){
Buff[count] = x;
count++;
if(count==Lmax) count=0;
}