Hi all,
I'm trying to read frequency from a 10 MHz crystal using OpenQCM's Arduino and shield, and their default .ino uses the FreqCount library with a 100 ms interval.
Problem is, that library measures the frequency during 1000 ms, but I want to measure every 100 ms. You can shorten the measurement interval, but this lowers the resolution too. It will now count for 100 ms and count the amount of upwards slopes as the frequency, but in reality it is 1/10th of the frequency since you measured 1/10th of the time. You have to multiply by 10 to get to Hz again, but then you're basically rounding to the nearest 10 Hz since the output variable "count" is an uint32_t. Is there a way to get the unrounded number?
Has anyone tried to make it a float or is there another way to decrease the measurement time without losing resolution?
I hope anyone has a solution... I'd really want a finer resolution in my data.
Thanks,
Joost
I'm trying to read frequency from a 10 MHz crystal using OpenQCM's Arduino and shield, and their default .ino uses the FreqCount library with a 100 ms interval.
Problem is, that library measures the frequency during 1000 ms, but I want to measure every 100 ms. You can shorten the measurement interval, but this lowers the resolution too. It will now count for 100 ms and count the amount of upwards slopes as the frequency, but in reality it is 1/10th of the frequency since you measured 1/10th of the time. You have to multiply by 10 to get to Hz again, but then you're basically rounding to the nearest 10 Hz since the output variable "count" is an uint32_t. Is there a way to get the unrounded number?
Has anyone tried to make it a float or is there another way to decrease the measurement time without losing resolution?
I hope anyone has a solution... I'd really want a finer resolution in my data.
Thanks,
Joost