mirror of
https://github.com/supleed2/ELEC60011-DSD-CW.git
synced 2024-12-22 21:55:48 +00:00
Optimised sumVector
This commit is contained in:
parent
00405c820c
commit
0ad87f0c97
|
@ -48,8 +48,8 @@ void generateVector(float x[N]){
|
||||||
|
|
||||||
float sumVector(float x[], int M){
|
float sumVector(float x[], int M){
|
||||||
float y = 0.0;
|
float y = 0.0;
|
||||||
for(int i = 0; i < M; i++){
|
for(int i = 0;i<=M;i++){
|
||||||
y += 0.5 * x[i] + x[i] * x[i] * cos((x[i] - 128.0) / 128.0);
|
y += (float)((int)x[i]>>1) + x[i]*x[i]*cosf((x[i]-128)*0.0078125);
|
||||||
}
|
}
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue