<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154230</link>
    <title>MATLAB Central Newsreader - Re: Upsample/FIR/downsample</title>
    <description>Feed for thread: Re: Upsample/FIR/downsample</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 09 Aug 2007 06:14:37 -0400</pubDate>
      <title>Re: Upsample/FIR/downsample</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154230#386937</link>
      <author> &quot;Ron N.</author>
      <description>On Aug 8, 2:28 pm, robert bristow-johnson &amp;lt;r...@audioimagination.com&amp;gt;&lt;br&gt;
wrote:&lt;br&gt;
&amp;gt; On Aug 8, 4:21 pm, R.Lyons@_BOGUS_ieee.org (Rick Lyons) wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; On Wed, 08 Aug 2007 17:31:32 -0000, robert bristow-johnson&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;r...@audioimagination.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;it depends on if you are ultimately upsampling (M&amp;lt;L) or downsampling&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;(M&amp;gt;L).  that's why i said&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;    h = fir1(N-1, min(1/M,1/L), kaiser(N,7.8562));&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt;     Regarding the fir1's freq argument, when&lt;br&gt;
&amp;gt; &amp;gt; I looked at mpowell's original decimation&lt;br&gt;
&amp;gt; &amp;gt; code, and the interpolation code example in MATLAB's&lt;br&gt;
&amp;gt; &amp;gt; hardcopy User's Manual, I originally thought&lt;br&gt;
&amp;gt; &amp;gt; mpowell made an error in his&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;   h = fir1(N,1/M,kaiser(N+1,7.8562))&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; where M = 160.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; It took me a while to figure it out (and it&lt;br&gt;
&amp;gt; &amp;gt; surprised me a little), with MATLAB's formating&lt;br&gt;
&amp;gt; &amp;gt; the fir1's freq argument should always be 1/160&lt;br&gt;
&amp;gt; &amp;gt; REGARDLESS of whether your interpolating or&lt;br&gt;
&amp;gt; &amp;gt; decimating!!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; i don't think i agree, Rick.  if you're UPsampling (switch the values&lt;br&gt;
&amp;gt; for M and L around, M=147 and L=160) then you want the cutoff&lt;br&gt;
&amp;gt; frequency to be Nyquist/L, no?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; e.g. converting a sound file from CD sampling rate (44.1 kHz) to DAT&lt;br&gt;
&amp;gt; or DAW or &quot;studio&quot; sampling rate (48 kHz).&lt;br&gt;
&lt;br&gt;
Wouldn't all the reconstruction filters on the&lt;br&gt;
way between two sample rates have the same cutoff;&lt;br&gt;
e.g. min(f1/2, f2/2) ?&lt;br&gt;
In the upsampling case one wants to make sure that&lt;br&gt;
any new samples don't introduce any new image&lt;br&gt;
spectral content.  And in the downsampling case,&lt;br&gt;
one wants to low pass filter first so that there&lt;br&gt;
will be no content at or above Fs/2 of the&lt;br&gt;
destination sample rate.&lt;br&gt;
&lt;br&gt;
I prefer to think of resampling as reconstruction,&lt;br&gt;
with all the polyphase and up/down intermediate rate&lt;br&gt;
stuff as just (major) implementation optimizations.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
IMHO. YMMV.&lt;br&gt;
--&lt;br&gt;
rhn A.T nicholson d.0.t C-o-M</description>
    </item>
  </channel>
</rss>

