title: Finding the frequency response of a bandpass filter
body: <p>I have this MATLAB assignment I need to do and thus far I have generated a mixed signal consisting of cosine functions of three frequencies values: 86Hz, 159Hz and 392Hz. I used a sampling frequency of 1Khz and generated one second worth of data. I then created the discrete fourier transform of this code which showed (what I think the purpose of the FT is) The most commonly occurring frequencies in the composite signal. The code and generated plots for this is shown below:</p>
  
  <pre><code>fs = 1000;
  t = (0 : 1/fs : 1)';
  f = [ 86, 159, 392 ];
  x = sum( cos(2*pi * t * f), 2 );
  y = fft(x);
  subplot(2,1,1), plot(t,x);
  subplot(2,1,2), stem(y,t);
  </code></pre>
  
  <p>(For the sake of expediency I'll omit the code for axis and plot titles). Here is the two figures that I have generated thus far for the report.</p>
  
  <p><img src="https://i.stack.imgur.com/IgTZn.jpg" alt="Mixed frequency signal and its DFT"></p>
  
  <p>The next part of the report asks this of me:</p>
  
  <p>"If we consider only the middle frequency of interest find the frequency response of a LTI system that filters out the higher and lower frequencies using the fourier transform"</p>
  
  <p>I need to know if there is some way this can be done automatically in MATLAB. I'm uncertain how to create this bandpass filter and then find its frequency response manually so I was wondering if there was some way MATLAB will do it automatically as I may be overthinking it.</p>