input: signal of shape (N) output: Wavelet_lf0 of shape(10, N), scales of shape(10)
(lf0)
| 51 | |
| 52 | |
| 53 | def get_lf0_cwt(lf0): |
| 54 | ''' |
| 55 | input: |
| 56 | signal of shape (N) |
| 57 | output: |
| 58 | Wavelet_lf0 of shape(10, N), scales of shape(10) |
| 59 | ''' |
| 60 | mother = wavelet.MexicanHat() |
| 61 | dt = 0.005 |
| 62 | dj = 1 |
| 63 | s0 = dt * 2 |
| 64 | J = 9 |
| 65 | |
| 66 | Wavelet_lf0, scales, _, _, _, _ = wavelet.cwt(np.squeeze(lf0), dt, dj, s0, J, mother) |
| 67 | # Wavelet.shape => (J + 1, len(lf0)) |
| 68 | Wavelet_lf0 = np.real(Wavelet_lf0).T |
| 69 | return Wavelet_lf0, scales |
| 70 | |
| 71 | |
| 72 | def norm_scale(Wavelet_lf0): |
no outgoing calls
no test coverage detected