help-octave
[Top][All Lists]

Re: I have modified firls.m to include all types of FIRs plus HT and dif

 From: je suis Subject: Re: I have modified firls.m to include all types of FIRs plus HT and diff Date: Mon, 22 May 2017 15:44:52 +0000

> I can't really help much, but looking at your function, shouldn't the
> lines:
>    q = (-pi*n'.*imag(expint(1i*n'*w(2:end)) + pi2) - ...
>     q = (-pi*n'.*imag(expint(1i*n'*w) + pi2) - cos(n'*w)./F)*K'
> have parens around the imag...pi2 section?  That is:
>    q = (-pi*n'.*(imag(expint(1i*n'*w(2:end)) + pi2)) - ...
>     q = (-pi*n'.*(imag(expint(1i*n'*w) + pi2)) - cos(n'*w)./F)*K'
> since the pi/2 is part of the Si(x), I think it should be that way.

Thank you for taking a look, that was a mistake, corrected, but also
my magnificent mathematical skills are to blame. When doing linear
interpolation, I know that the slope is (A2 - A1)/(f2 - f1) and that
the whole comes as slope*(x - f1) + A1, but what I did was consider
the (x - f1) as a whole term, thus, for the continuous version a*x+b,
I made b = A1, when, in fact, it's intercept = -slope*f1 + A1, and
then it comes as slope*x+intercept.

Now I am getting some results but, rather than keeping on uploading
versions, maybe it would be less time consuming if someone would
simply verify the inputs below.

---

firls(10, [0, 200, 300, 512]/512, [0, 1, 0, 0], 'd'), plot(abs(fft(h,
1024))(1:512))
0.04235469148728355
-0.08201413012272996
-0.0618119893535477
0.2018661528543597
0.3083554734960205
0
-0.3083554734960205
-0.2018661528543597
0.0618119893535477
0.08201413012272996
-0.04235469148728355

firls(11, [0, 200, 300, 512]/512, [0, 1, 0, 0], 'd'), plot(abs(fft(h,
1024))(1:512))
0.03732594529679734
-0.03433612793625151
-0.09696356417897994
0.07065147268158478
0.2931623606010482
0.1793606524572318
-0.1793606524572318
-0.2931623606010482
-0.07065147268158478
0.09696356417897994
0.03433612793625151
-0.03732594529679734

firls(30, [0, 200, 300, 512]/512, [0, 1, 0, 0], 'd'), plot(abs(fft(h,
1024))(1:512))
-0.001269277091273668
0.003198392108892278
0.001285061684276556
-0.008451971441951756
-0.00162882496078165
0.01772022558321762
0.002475017539728341
-0.03311523898587065
-0.004926273092083377
0.05871977740512246
0.01247729136542475
-0.1054747090506596
-0.04213126736540573
0.2142790732028212
0.2893569317389009
0
-0.2893569317389009
-0.2142790732028212
0.04213126736540573
0.1054747090506596
-0.01247729136542475
-0.05871977740512246
0.004926273092083377
0.03311523898587065
-0.002475017539728341
-0.01772022558321762
0.00162882496078165
0.008451971441951756
-0.001285061684276556
-0.003198392108892278
0.001269277091273668

firls(31, [0, 200, 300, 512]/512, [0, 1, 0, 0], 'd'), plot(abs(fft(h,
1024))(1:512))
-0.00148394238352223
0.002001300556950358
0.003704236399439953
-0.005504263029899814
-0.007962074902567284
0.01147150277313669
0.01551725107452073
-0.02078713878644933
-0.02870851767322025
0.03474477700849787
0.05295249630879661
-0.05567298153479006
-0.1063785931609718
0.08391965177763228
0.2962965843028105
0.1745324683632976
-0.1745324683632976
-0.2962965843028105
-0.08391965177763228
0.1063785931609718
0.05567298153479006
-0.05295249630879661
-0.03474477700849787
0.02870851767322025
0.02078713878644933
-0.01551725107452073
-0.01147150277313669
0.007962074902567284
0.005504263029899814
-0.003704236399439953
-0.002001300556950358
0.00148394238352223

reply via email to