- #1
Evo8
- 169
- 0
Homework Statement
Ok so I am slowly learning the syntax and various functions of Matlab. I am triyng to design and plot an FIR bandpass filter. Below is a coefficent h(k). I need to define this h(k) in 3 parts from what I understand. for k=0:p-1, k=p, and k=p+1:m to satisfy.
[itex]h(k)= \frac{sin(2 \pi(k-p)F_{1}T)-sin(2 \pi(k-p)F_{0}T)}{\pi(k-p)} [/itex]for o≤k≤m,k≠0
[itex]h(k)=2(F_{1}-F_{0})T [/itex] for k=p
[itex]h(k)=0
[/itex] otherwise
Homework Equations
N/A
The Attempt at a Solution
This is what I have
k=0:m;
h1=(sin(2*pi*(k-p)*f1)-sin(2*pi*(k-p)*f0))/(pi*(k-p));
This not fully correct. What I don't understand is how to put these ranges for the variable k within each string? Above I am defining it for the entire simulation. I don't even know how to properly search for this in google as I don't know what it would be called. I can't image it is too complicated but I just don't know the syntax. I've tried a couple of different ways but nothing really worked correctly.
Any help would be much appreciated!