Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).
Hi everyone,
I am doing a project recently, which involves converting a matlab code into the C code , and
doing implements on the TI 5510 DSK board. I don't have too much experience on c programming,
so I got some prblems on this. I have searched the previous posts, but I can't find similar
cases, so I have to ask here.
The matlab code I want to convert is:
for i=1:3
b=[gain zeros(1,round(d/i)) 1];
a=[1 zeros(1, round(d/i)) gain];
output = filter (b, a, output);
end
(gain, d, output are variables defined before.)
This is the filtering process actually. I don't know the way to generate b and a arrays; there
is a function "round" in CCS which has the same meaning with it in matlab, but I want
to know how to put some 0s in the arrays in C.
And this is a IIR filter. The IIR function in CCS is:
ushort oflag = iir32 (DATA *x, LDATA *h, DATA *r, LDATA *dbuffer, ushort nbiq, ushort nr)
There is only one variable "h" stores the coefficients. I am wondering how to add
both b and a in that function at same time?
I am the newbie in c programming, so could you please explain a little bit more specific?
Many thanks for your patient and time in advance!
------------------------------------
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution
for Commercial & Consumer End Equipment: www.ti.com/dm6467