Caution

You're reading an old version of this documentation. If you want up-to-date information, please have a look at 0.10.1.

# librosa.effects.deemphasis

librosa.effects.deemphasis(y, coef=0.95, zi=None)[source]

De-emphasize an audio signal with the inverse operation of preemphasis():

If y = preemphasis(x, coef=coef, zi=zi), the deemphasis is:

```>>> x[i] = y[i] + coef * x[i-1]
>>> x = deemphasis(y, coef=coef, zi=zi)
```
Parameters:
ynp.ndarray

Audio signal

coefpositive number

Pre-emphasis coefficient. Typical values of `coef` are between 0 and 1.

At the limit `coef=0`, the signal is unchanged.

At `coef=1`, the result is the first-order difference of the signal.

The default (0.97) matches the pre-emphasis filter used in the HTK implementation of MFCCs .

zinumber

Initial filter state. If inverting a previous preemphasis(), the same value should be used.

By default `zi` is initialized as `((2 - coef) * y - y) / (3 - coef)`. This value corresponds to the transformation of the default initialization of `zi` in `preemphasis()`, `2*x - x`.

Returns:
y_outnp.ndarray

de-emphasized signal

Examples

Apply a standard pre-emphasis filter and invert it with de-emphasis

```>>> y, sr = librosa.load(librosa.ex('trumpet'))
>>> y_filt = librosa.effects.preemphasis(y)
>>> y_deemph = librosa.effects.deemphasis(y_filt)
>>> np.allclose(y, y_deemph)
True
```
{"ft_lang_label":"__label__en","ft_lang_prob":0.5873406,"math_prob":0.95778686,"size":1360,"snap":"2023-40-2023-50","text_gpt3_token_len":385,"char_repetition_ratio":0.16224189,"word_repetition_ratio":0.0,"special_character_ratio":0.27720588,"punctuation_ratio":0.17293233,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98560256,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-28T01:44:52Z\",\"WARC-Record-ID\":\"<urn:uuid:304f443b-c8da-4440-9da4-ac730ea11a3f>\",\"Content-Length\":\"17748\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:dc8d63e0-fa25-4d1f-ad6b-b7dcabff9f6b>\",\"WARC-Concurrent-To\":\"<urn:uuid:ecb74ceb-1641-4ddc-87b6-2f8240f25d56>\",\"WARC-IP-Address\":\"185.199.110.153\",\"WARC-Target-URI\":\"http://librosa.org/doc/0.8.1/generated/librosa.effects.deemphasis.html\",\"WARC-Payload-Digest\":\"sha1:MRLVQMTMXFEOMFRZTZQ2Y5JC763VX5EV\",\"WARC-Block-Digest\":\"sha1:YA72HWSVKBSG3PRJRZZO2274WB7F5I7K\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510334.9_warc_CC-MAIN-20230927235044-20230928025044-00391.warc.gz\"}"}