mirror of
https://github.com/aicodix/dsp.git
synced 2026-04-27 22:35:45 +00:00
replaced pow(x, 2) with sqr(x)
This commit is contained in:
parent
8d3a6e83d8
commit
c848ae14f2
1 changed files with 5 additions and 1 deletions
|
|
@ -104,11 +104,15 @@ class Kaiser
|
|||
}
|
||||
return sum();
|
||||
}
|
||||
static TYPE sqr(TYPE x)
|
||||
{
|
||||
return x * x;
|
||||
}
|
||||
public:
|
||||
Kaiser(TYPE a) : a(a) {}
|
||||
TYPE operator () (int n, int N)
|
||||
{
|
||||
return i0(Const<TYPE>::Pi() * a * sqrt(TYPE(1) - pow(TYPE(2 * n) / TYPE(N - 1) - TYPE(1), TYPE(2)))) / i0(Const<TYPE>::Pi() * a);
|
||||
return i0(Const<TYPE>::Pi() * a * sqrt(TYPE(1) - sqr(TYPE(2 * n) / TYPE(N - 1) - TYPE(1)))) / i0(Const<TYPE>::Pi() * a);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue