# Instantaneous bandwidth

**URL:** <https://discourse.julialang.org/t/instantaneous-bandwidth/61260>\
**Category:** General Usage\
**Tags:** question, dsp\
**Created:** [May 16, 2021, 9:03pm UTC](https://discourse.julialang.org/t/instantaneous-bandwidth/61260 "2021-05-16T21:03:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidwallis](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@davidwallis](https://discourse.julialang.org/u/davidwallis)\
**Post date:** [May 16, 2021, 9:03pm UTC](https://discourse.julialang.org/t/instantaneous-bandwidth/61260/1 "2021-05-16T21:03:18Z")

</div>

Does anyone have a function to calculate instantaneous bandwidth? Like instbw in Matlab.

> **[Estimate instantaneous bandwidth - MATLAB instbw](https://www.mathworks.com/help/signal/ref/instbw.html)**
>
> This MATLAB function estimates the instantaneous bandwidth of a signal, x, sampled at a rate fs.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [May 16, 2021, 9:21pm UTC](https://discourse.julialang.org/t/instantaneous-bandwidth/61260/2 "2021-05-16T21:21:46Z")

</div>

The Matlab function, from its documentation, is a relatively simple post-processing of the spectrogram computed by `pspectrum`. So, if you compute the spectrogram using [`SignalAnalysis.tfd`](https://juliahub.com/docs/SignalAnalysis/7Vz2N/0.4.0/tfa.html) it should be straightforward to get the instantaneous bandwidth.

---

<div class="post-metadata">

**Author:** ![davidwallis](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@davidwallis](https://discourse.julialang.org/u/davidwallis)\
**Post date:** [May 17, 2021, 9:37am UTC](https://discourse.julialang.org/t/instantaneous-bandwidth/61260/3 "2021-05-17T09:37:55Z")

</div>

Thank you Steven.  
I think that will do the trick.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 17, 2021, 10:05am UTC](https://discourse.julialang.org/t/instantaneous-bandwidth/61260/4 "2021-05-17T10:05:23Z")

</div>

@davidwallis, would you mind posting the Julia solution you may come up with?

_NB: the Matlab implementation looks pretty good for this._

---

<div class="post-metadata">

**Author:** ![davidwallis](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@davidwallis](https://discourse.julialang.org/u/davidwallis)\
**Post date:** [May 17, 2021, 12:05pm UTC](https://discourse.julialang.org/t/instantaneous-bandwidth/61260/5 "2021-05-17T12:05:14Z")

</div>

I have to move on to something else for the moment.  
But I will send my solution when I have it.

Thanks all.
