Experiment: Doppler Effect
The experiment "Doppler Effect" measures the change of frequency from a reference signal due to the Doppler effect and is able to determine the relative speed between the phone and the sender of the reference signal.
You will need an audio source, which emits a tone with a constant frequency. It should be quite stable in the range of 300Hz to 5000Hz. A second smartphone with phyphox and the tone generator experiment or a music player (MP3 player with an audio file of a sine wave) work well. In contrast, some alarm siren circuits or Piezo alerts might not be stable enough as the emitted frequency drifts more than the Doppler effect.
There should be very little environmental noise during the experiment. Talking may already disturb the analysis as well as the sound from a loud motor from the setup (for example if you try to measure the speed of a toy train).
You might be able to improve your experiment by using an external external microphone.
Set the base frequency in the experiment settings to the frequency of your emitter. If you can change the tone of your emitter (like when the emitter is a phone with phyphox), 1000Hz is a good starting point (make sure to set the same frequency on both devices). Keep in mind, that you are limited to the frequencies that can be recorded by the microphone, which is optimized for voice recordings. Therefore, you have to keep in the range of 300Hz to approximately 5000Hz.
If you know the speed of sound (this is mostly only temperature dependent), you may enter it as well, although usually the error from the speed of sound is much smaller than other uncertainties.
Frequency range and time step are used to optimize the calculations. The defaults may be a good starting point, but if you try to measure particularly fast or slow movements, you probably have to optimize these.
The frequency range gives a hint to the algorithm which frequencies may be expected. If this value is smaller than the largest frequency shift in your experiment, the result will be cut off. On the other hand, larger values lead to slower calculations (especially on older phones) and if the range is close to or larger than the inverse of the value in time step, you will get strange results.
The time step corresponds to the time resolution at which the Doppler effect is sampled. If your only have slow changes in speed, you should try to increase this value as it acts similar to averaging the data. However, keep in mind that this also limits the frequency range that you may measure as this should not exceed the inverse of the time step.
Similar to the simple autocorrelation experiment this experiment uses the autocorrelation to determine the frequency. But instead of calculating the whole autocorrelation all the time, only the autocorrelation corresponding to the frequency range around the base frequency is calculated.
Also, in order to get a good time resolution, this is not calculated at the first maximum in the autocorrelation function, but at the very last within the frame of the time step. So, for example for the default settings (base frequency 1000 Hz, range 10 Hz, step 50 ms), only the autocorrelation around the 49th period (49 times 1/1000 s = 0.049ms) is calculated plus and minus the range of 10 Hz. This range falls just in the step time of 50ms.
Problems and resolutions
- The readings are noisy when there is no relative movement. This can have many reasons. First, you should check that your base frequency matches your sound source. If you are not sure, you can use the Audio Autocorrelation experiment to determine the frequency of your emitter. Note that you have to set it quite precisely, so if your emitter has a nominal frequency it might just not be exact enough, so check it with the Audio Autocorrelation. If the base frequency is correct and you are still measuring noise, make sure that there is no background noise present. The Doppler Effect algorithm is optimized to get results fast and is not as robust as the one from the simple autocorrelation experiment. If all fails, you should try a different emitter - a second phone at 1000Hz is quite reliable.
- The readings are noisy when the phone or the emitter is moving. If the readings are stable for stationary emitter and phone, but unusable while moving, the common causes are either a too small frequency range (the movement is so fast that the frequency shifts more than expected) or noise from the movement. The latter one can be from wind on the microphone or if you are using some kind of motor just the noise from the motor. Also remember that the sound amplitude is reduced with the square of the distance, or in other words, the volume of your emitter at the phone is reduced very fast when you increase the distance. You have to find a way to reduce the noise or increase the volume.
- phyphox reports a constant velocity while phone and emitter are resting. This simply means, that your base frequency is not exact. You should measure it with the Audio Autocorrelation experiment. If there still is a little offset from zero, you can try to change the frequency manually until it is on zero.