Commit 3ad3c1c
Enable Analog Filter Design (#458)
* Shift frequency normalization from construction of FilterType to filter design
When designing a digital filter using function digitalfilter() the
sampling frequency is not passed to the FilterType definition anymore,
but to function digitalfilter(). That means frequency normalization is
not done during construction of FilterType anymore, but during filter
design inside function digitalfilter().
For this the sampling frequency has to be passed to the internal
functions prewarp(), firprototype() and scalefactor() as well.
The intended side effect is, that an analog filter can now be designed
by specifying analog frequencies directly without any frequency
normalization and without a sampling frequency.
* Update documentation
* Extend filter design tests
Extend test case 'digital IIR' to test digital filter design with
non-normalized frequency values in the filter response definition and
specified sampling frequency.
* Fix test set "freq. scaling"
This is an amendment to commit 54bc9d5
where test sets have been introduced. The code following the current
test set "freq. scaling" is actually a "lowpass" test. It seems that a
corresponding comment on this low pass filter test was already missing
before this commit. And the comment "Freqency scaling" seems to be meant
for all four following test sets "lowpass", "highpass", "bandpass" and
"bandstop".
* Rename test set "freq. scaling" to "analogfilter"
The new test set name relates to the name of the tested function
`analogfilter()` and not to what it is doing.
* Remove unnecessary conversion of filter representation
In the current version the function `analogfilter()` already generates
a `ZeroPoleGain` filter representation. It seems, that in earlier
versions this wasn't the case (see e.g. commit
7fd2102)
* Update analog filter design tests using non-normalized frequency values
For providing new test data I had no MATLAB available and therefore
switched to Octave. Unfortunatelly Octave's elliptic filter design
function `ellip()` generates different filter coefficients than Julia
when designing a 20th order analog filter. Maybe this is a bug in
Octave's 'signal' package. I changed the test to design a Chebyshev
type II filter instead.
---------
Co-authored-by: Christian Gruber <Christian.Gruber-e6t@rub.de>
Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com>1 parent 2855b3e commit 3ad3c1c
File tree
5 files changed
+382
-361
lines changed- docs/src
- src/Filters
- test
5 files changed
+382
-361
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
118 | 130 | | |
119 | 131 | | |
120 | 132 | | |
| |||
192 | 204 | | |
193 | 205 | | |
194 | 206 | | |
195 | | - | |
| 207 | + | |
196 | 208 | | |
197 | | - | |
| 209 | + | |
198 | 210 | | |
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
202 | 214 | | |
203 | 215 | | |
204 | | - | |
| 216 | + | |
205 | 217 | | |
206 | | - | |
| 218 | + | |
207 | 219 | | |
208 | 220 | | |
209 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | | - | |
251 | | - | |
252 | | - | |
| 250 | + | |
253 | 251 | | |
254 | | - | |
| 252 | + | |
255 | 253 | | |
256 | 254 | | |
257 | 255 | | |
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
261 | | - | |
| 259 | + | |
262 | 260 | | |
263 | | - | |
264 | | - | |
265 | | - | |
| 261 | + | |
266 | 262 | | |
267 | | - | |
| 263 | + | |
268 | 264 | | |
269 | 265 | | |
270 | 266 | | |
271 | 267 | | |
272 | 268 | | |
273 | 269 | | |
274 | 270 | | |
275 | | - | |
| 271 | + | |
276 | 272 | | |
277 | | - | |
278 | | - | |
279 | | - | |
| 273 | + | |
280 | 274 | | |
281 | | - | |
| 275 | + | |
282 | 276 | | |
283 | | - | |
| 277 | + | |
284 | 278 | | |
285 | 279 | | |
286 | 280 | | |
| |||
289 | 283 | | |
290 | 284 | | |
291 | 285 | | |
292 | | - | |
| 286 | + | |
293 | 287 | | |
294 | | - | |
295 | | - | |
296 | | - | |
| 288 | + | |
297 | 289 | | |
298 | | - | |
| 290 | + | |
299 | 291 | | |
300 | | - | |
| 292 | + | |
301 | 293 | | |
302 | 294 | | |
303 | 295 | | |
| |||
444 | 436 | | |
445 | 437 | | |
446 | 438 | | |
447 | | - | |
448 | | - | |
| 439 | + | |
| 440 | + | |
449 | 441 | | |
450 | 442 | | |
451 | 443 | | |
452 | 444 | | |
453 | 445 | | |
454 | | - | |
| 446 | + | |
455 | 447 | | |
456 | 448 | | |
457 | 449 | | |
458 | 450 | | |
459 | | - | |
460 | | - | |
| 451 | + | |
| 452 | + | |
461 | 453 | | |
462 | 454 | | |
463 | 455 | | |
| |||
541 | 533 | | |
542 | 534 | | |
543 | 535 | | |
544 | | - | |
545 | | - | |
| 536 | + | |
| 537 | + | |
546 | 538 | | |
547 | 539 | | |
548 | 540 | | |
549 | 541 | | |
550 | | - | |
551 | | - | |
552 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
553 | 545 | | |
554 | 546 | | |
555 | 547 | | |
556 | 548 | | |
557 | | - | |
558 | | - | |
| 549 | + | |
| 550 | + | |
559 | 551 | | |
560 | 552 | | |
561 | 553 | | |
562 | 554 | | |
563 | 555 | | |
564 | 556 | | |
565 | 557 | | |
566 | | - | |
567 | | - | |
568 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
569 | 561 | | |
570 | 562 | | |
571 | 563 | | |
572 | 564 | | |
573 | 565 | | |
574 | 566 | | |
575 | 567 | | |
576 | | - | |
577 | | - | |
| 568 | + | |
| 569 | + | |
578 | 570 | | |
579 | 571 | | |
580 | 572 | | |
581 | 573 | | |
582 | 574 | | |
583 | 575 | | |
584 | | - | |
| 576 | + | |
585 | 577 | | |
586 | | - | |
| 578 | + | |
587 | 579 | | |
588 | 580 | | |
589 | 581 | | |
590 | 582 | | |
591 | 583 | | |
592 | 584 | | |
593 | 585 | | |
594 | | - | |
595 | | - | |
| 586 | + | |
| 587 | + | |
596 | 588 | | |
597 | 589 | | |
598 | | - | |
| 590 | + | |
599 | 591 | | |
600 | 592 | | |
601 | 593 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | | - | |
| 354 | + | |
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
| |||
0 commit comments