脉冲计数算法 [英] Pulse counting algorithm

查看:166
本文介绍了脉冲计数算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我真的很喜欢数学,所以我要在这里问这个.今天花了大部分时间在Google搜寻中没有太多运气...

问题是,您将使用哪种算法来计算周期信号的频率?有问题的信号不是干净的正弦波,而是来自传感器的嘈杂脉冲.

我目前的计划是使用快速傅立叶变换来挑选出最大的频率分量,但是实现起来似乎有些艰巨,而我使用的硬件是带有8K内存的16位微控制器-可能不会达到那种处理水平.

另一个计划是低通滤波器(数字滤波器,也可以由软件来完成,以消除噪声)并计算峰值,以排除通过的杂散.

这有意义还是我完全离开了?还有更好的方法吗?
(免费/开源代码也很好,但是我可以自己编写程序)



更新
我发现傅里叶方法确实有效,但是仅使用Excel检验了理论.我敢打赌,没人知道Excel可以做到这一点:)
链接 [移动平均值 [

OK, so I really suck at math so I''m going to ask this here. Spent most of today Googling without much luck...

The question is, what algorithm would you use to calculate the frequency of a periodic signal? The signal in question is not a clean sine wave, but a noisy pulse from a sensor.

My current plan is to use a fast Fourier Transform to single out the largest frequency component, but it looks a bit daunting to implement, and the hardware I''m using is a 16 bit micro-controller with 8K of memory - it may not be up to that level of processing.

Another plan is to low-pass filter (digital filter, also done by software, to remove noise) and count the peaks, throwing out spurious ones that get through.

Does this make sense or am I completely off? Any better methods?
(Free/open source code would be nice too, but I can do the programming myself)



Update
I discovered that the Fourier method does indeed work, but only checked the theory using Excel. I bet nobody knows Excel can do that :)
link[^]
The highest peak is the fundamental frequency, that I want to measure, but the waveform shown is not the real thing (not allowed to reveal that)

However, I''m inclined to go ahead with Carlo''s method of counting level-crossings (after applying some kind of smoothing ). Updates will be posted if it goes as planned.



Update 2
I finally implemented the level-crossing method, using a moving average[^] to filter out noise first. A few more tweaks were needed to remove spurious peaks too.

推荐答案

基于波形的已知属性,您不能简单地计数事件 (例如穿越给定水平)?
Cannot you simply count events, based on a known property of the waveform (for instance crossing a given level)?


这篇关于脉冲计数算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆