<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis Microcontrollers中的主题 Re: IIR Filter on the KL25Z</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299296#M12435</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Tomas,&lt;/P&gt;&lt;P&gt;Thanks for the reply. Yes, that makes sense. How did you set your ADC to sample at a specific frequency? Did you use a wait function or a timer of some sort?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;- Nick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Apr 2014 21:29:20 GMT</pubDate>
    <dc:creator>nick92</dc:creator>
    <dc:date>2014-04-18T21:29:20Z</dc:date>
    <item>
      <title>IIR Filter on the KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299294#M12433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-top: 5px; margin-bottom: 5px; color: #000000; font-family: verdana, arial, helvetica, sans-serif; font-size: small;"&gt;Hey guys, I'm trying to implement a simple 2 pole IIR filter on my KL25Z. Coefficients were calculated using Matlab, it's a Butterworth Highpass, second order, Fs at 10 KHz, and Cut off at 60 Hz. I'm feeding in a mixed signal sin(2&lt;EM&gt;pi&lt;/EM&gt;80&lt;EM&gt;t)+sin(2&lt;/EM&gt;pi&lt;EM&gt;175&lt;/EM&gt;t) which is generated by one of the boards to the the other board which is running the IIR filter program.&lt;/P&gt;&lt;P style="margin-top: 5px; margin-bottom: 5px; color: #000000; font-family: verdana, arial, helvetica, sans-serif; font-size: small;"&gt;Here's the code: &lt;A href="http://imgur.com/NDqYXfT" style="color: #336699;"&gt;http://imgur.com/NDqYXfT&lt;/A&gt; &lt;/P&gt;&lt;P style="margin-top: 5px; margin-bottom: 5px; color: #000000; font-family: verdana, arial, helvetica, sans-serif; font-size: small;"&gt;Here's what I'm feeding into my filtering board:&lt;A href="http://imgur.com/d7NzRzG" style="color: #336699;"&gt;http://imgur.com/d7NzRzG&lt;/A&gt; &lt;/P&gt;&lt;P style="margin-top: 5px; margin-bottom: 5px; color: #000000; font-family: verdana, arial, helvetica, sans-serif; font-size: small;"&gt;Here's the filter board DAC output: &lt;A href="http://imgur.com/Vmjn9LH" style="color: #336699;"&gt;http://imgur.com/Vmjn9LH&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-top: 5px; margin-bottom: 5px; color: #000000; font-family: verdana, arial, helvetica, sans-serif; font-size: small;"&gt;I'm expecting the 80Hz sinewave to remain at the output, or at least something similar (I know these filters are not perfect), but the output looks like an audiowave or some sort. Can't figure out why. You guys have an idea what it is or maybe there's some error in my code (most likely). Thanks a lot guys!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 20:30:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299294#M12433</guid>
      <dc:creator>nick92</dc:creator>
      <dc:date>2014-04-17T20:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: IIR Filter on the KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299295#M12434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi, i have used IIR filters on mcu.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;y[j]=B[0]*x[j]+B[1]*x[j-1]+B[2]*x[j-2]-A[1]*y[j-1]-A[2]*y[j-2]; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;A,B coefficients were from matlab, And it worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Your code looks good. But filter &lt;/SPAN&gt;to work, for(;;) cycle must sample at 10kHzrate as you chosen in matlab. And now i dont see any timing in code, that means that it samples as fast as it can. Maybe thats a problem. I think that coefficients are correlated with sampling frequency, in matlab [B,A]=butter(order,Wn,'type'), Wn=0:1, Wn = fcutoff/fsampling. Nice oscilloscope thought.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Apr 2014 20:12:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299295#M12434</guid>
      <dc:creator>tomasmickus</dc:creator>
      <dc:date>2014-04-18T20:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: IIR Filter on the KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299296#M12435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Tomas,&lt;/P&gt;&lt;P&gt;Thanks for the reply. Yes, that makes sense. How did you set your ADC to sample at a specific frequency? Did you use a wait function or a timer of some sort?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;- Nick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Apr 2014 21:29:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299296#M12435</guid>
      <dc:creator>nick92</dc:creator>
      <dc:date>2014-04-18T21:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: IIR Filter on the KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299297#M12436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How i do it, add TimerInt_LDD (Timer Interrupt) component from processor expert component library, in component inspector set interrupt period, compile... Events.c file have intrrupt functions.&lt;/P&gt;&lt;P&gt;//Events.c&lt;/P&gt;&lt;P&gt;bool need_to_sample = 0;&lt;/P&gt;&lt;P&gt;void TI1_OnInterrupt(LDD_TUserData *UserDataPtr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; need_to_sample= 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your code here ... */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;/* END Events */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//ProcessorExpert.c&lt;/P&gt;&lt;P&gt;extern bool need_to_sample;&lt;/P&gt;&lt;P&gt;int main(){&lt;/P&gt;&lt;P&gt;for(;;)&lt;/P&gt;&lt;P&gt;if(need_to_sample){&lt;/P&gt;&lt;P&gt;//your code&lt;/P&gt;&lt;P&gt;need_to_sample=0;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT. This configuration only protects that mcu would not sample at higher rates than set, but not from lowers. Figure out yourselt :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Apr 2014 06:32:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299297#M12436</guid>
      <dc:creator>tomasmickus</dc:creator>
      <dc:date>2014-04-19T06:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: IIR Filter on the KL25Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299298#M12437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Tomas, thanks for your suggestion, I will try a few things now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 13:52:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/IIR-Filter-on-the-KL25Z/m-p/299298#M12437</guid>
      <dc:creator>nick92</dc:creator>
      <dc:date>2014-04-22T13:52:17Z</dc:date>
    </item>
  </channel>
</rss>

