Implement code that simulates the speed of a car as a signal plus noise, with 50 elements. The speed value increases linearly from 0-50 km / h. The noise amplitude is ± 1 km / h. The values are sent to the console with a precision of three significant digits. Display sample results on console and plotter. How would the noise?
float maximo = 50;
float minimo = 0;
float variac = 1;
float percent = ?;
float N = (maximo - minimo) / abs(variac);
float amplitude = (maximo - minimo)/2;
float offset = (maximo + minimo)/2;
void setup(){
Serial.begin(2400);
for(int i=0;i<=N;i++){
Serial.print(variac*i +minimo);
Serial.println(percent*amplitude*random(-100,101)/100.0);
Serial.println(percent*amplitude*random(-100,101)/100.0 + variac*i +minimo, 6);
}
}