Skip to content

AttributeError: 'TfData' object has no attribute 'shrink_mask'

An undesirable error is generated in the example below, when calling plt.imshow(Y) where Y is a TfData (with real values). To be avoided?

import numpy as np
import matplotlib.pyplot as plt
from ltfatpy import gspi
from pyteuf import Stft

x, fs = gspi()

win_len = 2048
stft_params = {
    'win_name': 'hann',
    'win_len': win_len,
    'hop': win_len // 2,
    'n_bins': win_len,
    'convention': 'bp',
    'zero_pad_full_sig': False,
    'param_constraint': 'fix',
}
stft = Stft(**stft_params)
X = stft.apply(x)
Y = np.abs(X)

plt.imshow(Y)
Edited by Valentin Emiya