<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: measure frequency on pin</title>
		<link>http://forums.leaflabs.com/topic.php?id=10262</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:07:46 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=10262" rel="self" type="application/rss+xml" />

		<item>
			<title>iainism on "measure frequency on pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10262#post-22683</link>
			<pubDate>Wed, 27 Feb 2013 11:07:40 +0000</pubDate>
			<dc:creator>iainism</dc:creator>
			<guid isPermaLink="false">22683@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Final thought (after a brief re-read of my DSP notes), if you need to detect a number of tones (fixed frequencies) in the range then you could also use the Goertzel algorithm, this provides a lower computational load.  There's a nice article over at embedded.com on the use of this along with a code listing: &#60;a href=&#34;http://www.embedded.com/design/configurable-systems/4024443/The-Goertzel-Algorithm&#34; rel=&#34;nofollow&#34;&#62;http://www.embedded.com/design/configurable-systems/4024443/The-Goertzel-Algorithm&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>iainism on "measure frequency on pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10262#post-22679</link>
			<pubDate>Wed, 27 Feb 2013 08:56:46 +0000</pubDate>
			<dc:creator>iainism</dc:creator>
			<guid isPermaLink="false">22679@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;stafil - additional information to gbulmer's question...&#60;/p&#62;
&#60;p&#62;If your signal is below the level at which you can set an interrupt using a GPIO pin (or if you don't know what level it will arrive at, or you are dealing with a 'complex' waveform) then you may need to use an ADC and this means you'll need to do some signal processing work.&#60;/p&#62;
&#60;p&#62;Based on what you've said then in a noiseless environment you would (theoretically) need to sample over a window of ~10 ms at a rate &#38;gt; 1600 Hz to get a good result and then apply a DFT to get the information that you require.  The DFT part is not too onerous, there are various code examples and libraries out there on the web.  For example, &#60;a href=&#34;http://sourceforge.net/projects/kissfft/&#34; rel=&#34;nofollow&#34;&#62;http://sourceforge.net/projects/kissfft/&#60;/a&#62; (caveat: this was the first link I found on Google for 'embedded fft library', and may or may not be compatible with the Maple, I don't know, I've never tried it!)&#60;/p&#62;
&#60;p&#62;But of course we must (usually) deal with noise so I'd suggest sampling at 6400 Hz and a window of 10 ms to get a nice, 'power of two' number of samples within the window, pad this up with zeros to a total length of 128 samples and do any required filtering to minimise noise prior to the DFT.  If you need help designing a filter then I can recommend this:  &#60;a href=&#34;http://www-users.cs.york.ac.uk/~fisher/mkfilter/&#34; rel=&#34;nofollow&#34;&#62;http://www-users.cs.york.ac.uk/~fisher/mkfilter/&#60;/a&#62; (it's saved me a lot of work in the past!)&#60;/p&#62;
&#60;p&#62;If you have a lot of noise, a known signal frequency and just want to check for the presence of the signal then you could even use a software-PLL or the cross-correlation of the sampled data with 'specimen' data and make a judgement based on their output as to whether the signal is present.  (But these are probably massive overkill!)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "measure frequency on pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10262#post-22512</link>
			<pubDate>Tue, 26 Feb 2013 08:04:11 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">22512@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;stafil - what approach have you tried? &#60;/p&#62;
&#60;p&#62;How accurate and precise do you need? Is &#60;code&#62;digitalRead&#60;/code&#62;'ing the status of a pin and timing using &#60;code&#62;micros&#60;/code&#62; good enough?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stafil on "measure frequency on pin"</title>
			<link>http://forums.leaflabs.com/topic.php?id=10262#post-22446</link>
			<pubDate>Mon, 25 Feb 2013 14:28:27 +0000</pubDate>
			<dc:creator>stafil</dc:creator>
			<guid isPermaLink="false">22446@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;How I measure frequency on pin? Pls sample code. I have measure frequency 200Hz - 800Hz.&#60;/p&#62;
&#60;p&#62;Pls help me
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
