|
I'm taking a signals and systems course this summer and the professor sprang this project on us near the end of semester without ever introducing us to matlab. I've used the program before but never for a big project like this, although I think I'm learning it rather quickly. I am however, getting stumped here.
I'm trying to code this filter in matlab, I know to define t as t=linspace(-pi/2,pi/2,17) but I guess what is confusing me the most is the part about defining the value of K.
Consider the filter {hn} which is defined by the sampled values of the cosine wave h(t) = K cos(t), t ∈ (−π/2, π/2), at 17 points uniformly distributed in the interval (−π/2, π/2). Define value of K from the condition Σh_n = 1
|
I'm taking a signals and systems course this summer and the professor sprang this project on us near the end of semester without ever introducing us to matlab Wait what? You guys really went through a whole semester of signals and systems without any matlab models? What school is this?
|
Isn't K the amplifying constant or something? I vaguely remember doing this in my Signals class. If you increased K, it would increase the response time or something, but at the same time cause a lot of overshoot. Don't really remember though, but I remember putting in random values in MATLAB for K. It sounds like you're trying to solve for a specific K value
|
oh god, matlab, i hated that program. Can't you email your professor asking him for some kind of guide or advice about the project?
|
h=cos(t) h=h/sum(h)
output is now sum(h)=1
...profit? I'm not sure if this is right but it does make sum(h)=1 lululul
actually I'm pretty positive it's right...guess I just needed to visit teamliquid to get my brain to work properly
|
What kind of filter are you talking about? At what frequency range do you need the amplification to be = 1?
|
Isn't it just Σh_n = ΣK cos(pi/(2*17)*n - pi/2) = 1 => K = 1/ ΣK cos(pi/(2*17)*n - pi/2)? n=0...17
This is because the gain of the filter is Σ|h(n)|^2 and you probably want that to be 1.
Or am I being stupid?
(I have read a couple of signals and systems/dsp/control courses)
|
I'm taking a swing at this. Converting the signal from cont. to discrete:
sum(h{n})= k sum[from n=-8 to 8] cos(n * pi /16)
The logic here is 1 period of the time domain is 2 * pi, and 1 period is 32 samples (16 in half a cycle, the 17 includes a point in the second half, which would mean h{n=-8}=0, and h{n=8}=0... thats how i understand it). Sorry my sum doesnt start at 0, you can shift if you like. Note our domain is the positive part of the cosine graph. You should just be able to set the equation equal to 1, then evaluate.
1= k sum[from n=-8 to 8] cos(n * pi /16)
edit: changed wording
|
A bit rusty, but I think K=2. The best way is to just test the results and see what you get.
|
My partner did everything, I only tested so I don't really know >.<
|
|
|
|