From: Jonathan Albrecht on
Hi,

I need to calculate the sampling frequency between two peaks before applying a filter and combining them to another file.
I am combining graphs from two systems that I am collecting data. I already that one system collects data at 100Hz but the other system is supposed to collect data at 50Hz (sampling frequency I am choosing when I setup the machine). But the problem is each time I am collecting data with the second system and even if I configured it to 50Hz I still have different frequencies from one data collection to another ( 45Hz to 65Hz sometimes).
Instead of calculate manually the frequency I would like to create an m file that I will be able to calculate this and integrate this m file to my filter file.

I hope it is enough clear.

Thanks a lot!
From: Wayne King on
"Jonathan Albrecht" <jonathan.albrecht6(a)gmail.com> wrote in message <hv49t8$oaj$1(a)fred.mathworks.com>...
> Hi,
>
> I need to calculate the sampling frequency between two peaks before applying a filter and combining them to another file.
> I am combining graphs from two systems that I am collecting data. I already that one system collects data at 100Hz but the other system is supposed to collect data at 50Hz (sampling frequency I am choosing when I setup the machine). But the problem is each time I am collecting data with the second system and even if I configured it to 50Hz I still have different frequencies from one data collection to another ( 45Hz to 65Hz sometimes).
> Instead of calculate manually the frequency I would like to create an m file that I will be able to calculate this and integrate this m file to my filter file.
>
> I hope it is enough clear.
>
> Thanks a lot!

Hi Jonathan, I don't understand something. You say that you are sampling in one instance at 50 Hz, but then you are talking about resolving frequencies from 45 to 65 Hz? Do you really expect your data to have oscillations at those frequencies? If so, then sampling the data at 50 Hz is not adequate. Sampling at 100 Hz is not adequate if the data contains an oscillation at 65 Hz.

Wayne