Add assertion to prevent generation of degenerate linear_to_mel_weight_matrix.
Prior to this change if upper_edge_hertz is larger than sample_rate / 2 (the highest frequency present in the linear spectrogram), the returned matrix would contain columns that are all zeros. This is likely a surprising result for those that are unfamiliar with signal processing, so it seems safer to raise an exception on such a misconfiguration than to silently allow users to generate poorly behaved features. PiperOrigin-RevId: 181407176
Loading
Please sign in to comment