title: Entering sampling rate when displaying digital filter response in Matlab
body: <p>I am trying to use <code>fvtool</code> function in Matlab (2011a).</p>
  
  <p>This is an interactive "tool" composed of many functions. My code goes like this:</p>
  
  <pre><code>%fs1=256; fs2=64; fs3=32; 
  b1 = fir1(52,0.25,kaiser(53,7.85726));
  b2 = fir1(40,0.5,kaiser(41,7.85726));
  b3 = fir1(204,0.5,kaiser(205,10.0613));
  fvtool(b1,1,b2,1,b3,1);
  </code></pre>
  
  <p>This produces:
  <img src="https://i.stack.imgur.com/QTct8.png" alt="http://www.4shared.com/photo/sZunQTHJ/1_online.html"></p>
  
  <p>Now I go to the "analysis" menue and choose "sampling frequency", and enter the sampling freq. for each filter. The result is:</p>
  
  <p><img src="https://i.stack.imgur.com/KIOG3.png" alt="http://www.4shared.com/photo/sZunQTHJ/2_online.html"></p>
  
  <p>Not very good, since the response of the second and third filters is repeating. The response of the first filter is fine, going from 0 to 256/2=128 Hz. I would like to have the response of the second and third filters to go up to 64/2=32 and 32/2=16. respectively.</p>
  
  <p>So I tried to manually do it,  </p>
  
  <pre><code>%Digital filter:
  fs1=256; fs2=64; fs3=32; 
  b1 = fir1(52,0.25,kaiser(53,7.85726));  b1(end+256)=0;
  b2 = fir1(40,0.5,kaiser(41,7.85726));   b2(end+448)=0;
  b3 = fir1(204,0.5,kaiser(205,10.0613)); b3(end+480)=0;
  
  %Filters Response
  n=1024;
  w = logspace(-1,2,n);
  
  digi_1 = freqz(b1,1,n,fs1); semilogx(w,20*log10(abs(digi_1)),'Color','k'); hold on
  digi_2 = freqz(b2,1,n,fs2); semilogx(w,20*log10(abs(digi_2)),'Color','b'); hold on
  digi_3 = freqz(b3,1,n,fs3); semilogx(w,20*log10(abs(digi_3)),'Color','r'); 
  axis ([0.1 128 -140 10])
  </code></pre>
  
  <p>Here I used freqz and give it the filter numerator and denomenator, plus the number of points n, plus the sampling freq. fs. The problem is that Matlab does not seem to do any change with or without the sampling freq., i.e. if I left it nothing change.</p>
  
  <p>So if someone wants to help, he/she would either help me with <code>fvtools</code> or with my manual code which is a step late than <code>fvtools</code>.</p>