- #1

bwhitejr

- 2

- 0

I am trying to convert a file that has three arrays of 528 samples into three arrays of 301.

The first is log spaced frequency points the second is the impedance values at each frequency and the last is phase values. I have the routines spline and splint. My problem is the the second to last sample [299] is off scale. The last sample [300] is correct. I know it is some kind of boundary problem, but it is beyond me to figure it out.

fr,re,ph are arrays[1..528] of float

Spline(fr,re,528,re[1],re[528],y2);

Spline(fr,ph,528,ph[1],ph[528],y4);

fm:=Power((20000.0/10.0),1.0/300);

For i:=1 to 301 do

begin

tempARRF

*:=10.0*Power(fm,i-1);*

end;

For i:=1 to 301 do

begin

splint(fr,re,y2,528,tempARRF

end;

For i:=1 to 301 do

begin

splint(fr,re,y2,528,tempARRF

*,tempARRR**);*

splint(fr,ph,y4,528,tempARRFsplint(fr,ph,y4,528,tempARRF

*,tempARRP**);*

end;

CloseFile(impFile);

For i:=0 to 300 do

begin

impARRend;

CloseFile(impFile);

For i:=0 to 300 do

begin

impARR

*.Freq:=tempARRF[i+1];*

impARRimpARR

*.Res:=tempARRR[i+1];*

impARRimpARR

*.Phs:=tempARRP[i+1];*

end;end;