I have the following two things.
sequence_1: Sound file in the wave format.
PSD_1: Some PSD (Power Spectral Density).
I want that the PSD(sequence_1) < PSD_1 for all indices.
How I think about this is: I want to clip sequence_1 by PSD_1.
Does anyone have an idea how to achieve this? I try to do this with tensorflow in python. But the answer can also be more general. I think I need something like an equalizer over time but I don't know how to do that.
edit2: Motivation: PSD_1 is a hearing threshold of the original signal. I want to do some stuff with the signal but don't want it to be audiable (so PSD of the signal needs to be less than the PSD of the hearing threshold) But the hearing threshold is computed in the time frequency domain.
clarification: I can not just invert the PSD. Because PSD is not an invertible function.
edit: I formalize it more here.
- PSD(sequence_1) gives a strength for a specific window of time and frequency.
- The PSD_1 has the same dimensions.
- Now for a given time t and a given frequency f, I want that PSD(sequence_1)[t][f] < PSD_1[t][f].
- Say without loss of generality the PSD(sequence_1)[t][f] > PSD_1[t][f].
- Now I want to change sequence_1 such that PSD(fun(sequence_1))[t][f] < PSD_1[t][f] holds.
- Therefore I need to change sequence_1 more or less at time t.
- What function [fun(sequence_1)] achieves this? I thought about an equalizer as this can lower certain frequencies. But I'm not an audio expert. I need to implement it. So a library or a formula telling me how to do it would be great.
- Additionally I only want to lower the frequency in a minimal manner. So the optimal outcome would be: PSD(fun(sequence_1))[t][f] == PSD_1[t][f]