Construct a pattern classified according to the Rabiner-Juang scheme (Rabiner1993) See documentation for the StepPattern class.
(ptype, slope_weighting="d", smoothed=False)
| 444 | |
| 445 | |
| 446 | def rabinerJuangStepPattern(ptype, slope_weighting="d", smoothed=False): |
| 447 | """Construct a pattern classified according to the Rabiner-Juang scheme (Rabiner1993) |
| 448 | |
| 449 | See documentation for the StepPattern class. |
| 450 | """ |
| 451 | |
| 452 | f = { |
| 453 | 1: _RJtypeI, |
| 454 | 2: _RJtypeII, |
| 455 | 3: _RJtypeIII, |
| 456 | 4: _RJtypeIV, |
| 457 | 5: _RJtypeV, |
| 458 | 6: _RJtypeVI, |
| 459 | 7: _RJtypeVII |
| 460 | }.get(ptype, lambda: _error("Invalid type")) |
| 461 | |
| 462 | r = f(slope_weighting, smoothed) |
| 463 | norm = "NA" |
| 464 | if slope_weighting == "c": |
| 465 | norm = "N" |
| 466 | elif slope_weighting == "d": |
| 467 | norm = "N+M" |
| 468 | |
| 469 | return StepPattern(r, norm) |
| 470 | |
| 471 | |
| 472 | def _RJtypeI(s, m): |