************************************* Lab 1 - One-dimensional Kalman filter ************************************* In this lab, you will design your own filter for a thermometer. The sensor for the thermometer outputs a voltage that corresponds to the temperature that is being measured. The manufacturer's specifications for the sensor tell you that the sensor exhibits white noise with a standard deviation of 0.13 volts. 1. Create a function :code:`volt(voltage, std)` that simulate the temperature measurement. Now for the prediction. We do not consider a sensor for the *movement* in the voltage. We have no known movement, so we will set that to zero. However, that means that we are predicting that the temperature will never change. If that is true, then over time we should become extremely confident in our results. Once the filter has enough measurements it will become very confident that it can predict the subsequent temperatures, and this will lead it to ignore measurements that result due to an actual temperature change. This is called a *smug* filter, and is something you want to avoid. 2. Create the initial belief state :code:`x` centred at 25 with a variance of 1000. 3. Create the :code:`process_model` (gaussian) centred in 0 with a variance of :math:`.05^2`. 4. Create a function :code:`generate_measurement(n)` that will generate :code:`n` measurements. 5. Create a function :code:`kalman_filter(x, zs, process_model, voltage_std)` that will implement the kalman filter, where * :code:`x`: the initial belief state * :code:`zs`: the measurements generated * :code:`process_model`: the process model * :code:`voltage_std`: the std of the voltage. If we consider an actual voltage of 16.3, we obtain something close to the following figures. .. figure:: ../pyplots/lab1_volt.png :align: center .. figure:: ../pyplots/lab1_volt_variance.png :align: center 6. Change the value of the actual voltage and see what happens.