<p>The bandpass filter in Raven uses a Kaiser Window FIR filter, which has a very high stop band attenuation (100dB), and a very rapid transition from pass-band to stop-band. This is very good for completely removing certain frequencies.</p>
<p>A Butterworth filter can usually be configured with an order, the higher the order, the more attenuation you will get. If the order is not configurable, as @Noil mentioned you can repeat the filter operation until you get the desired attenuation.</p>
<p>A bandpass filter can be used as a lowpass if the lower limit is 0 Hz.
I'm not familiar with Audition, but in Raven using a bandpass filter usually gives you something like this:</p>
<p>Original signal:</p>
<p><a href="https://i.sstatic.net/tByuN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tByuN.png" alt="original signal" /></a></p>
<p>And with a bandpass with a high limit of 1kHz:<a href="https://i.sstatic.net/gbnMh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gbnMh.png" alt="filtered" /></a></p>

CC BY-SA 4.0
2022-06-27T12:42:36.403Z
Clear answer on the effect of steep filtering. As mentioned in previous comments/answers - could you double check that the spectrogram color bar has the same mapping (e.g. set the color bar manually or to be fixed to a particular range of values?)
Thejasvi
CC BY-SA 4.0
2022-06-23T19:44:20.767Z
2022-10-15T21:13:58.237Z
2022-10-15T21:13:58.237Z
B. Thomas
<p>To remove the content above a given frequency, you should use a &quot;low-pass filter&quot;.</p>
<p>From your spectrogram, it seems that you applied a low-pass filter on the first part of the signal only. Are you sure you selected the whole signal before applying the filter?</p>
<p>The filtering process just removes a given amount of energy (e.g. -3 dB or -3 dB per octave) on a particular frequency band (in your case above a given frequency). Then applying 1 filter might not be enough for the application you require. You can reiterate the filtering until you have reached the amount of filtered energy that suits you.</p>
<hr />
<p><strong>EDIT:</strong> The last spectrogram you added (after you edited your question) looks good to me.</p>
<ul>
<li>Don't forget that the color scale is in dB and depends on the default range mapping: it can look like there are still a good amount of energy (i.e. bright color) while it can actually be negligible for your application.</li>
<li>Especially, the vertical yellow band that remains in your higher frequency range are not likely an artifact of the filtering, it just means that the energy was initially greater there than in the background. These vertical bands still look far less loud than your low-frequency range; but check the color scale.</li>
</ul>

CC BY-SA 4.0
2022-06-23T16:41:47.623Z
Thank you for this!
Interestingly, you are right, it seems that the batch filtering only worked on the beginning of the call. I have updated the question to add more details!
Potichien
CC BY-SA 4.0
2022-06-24T09:16:45.357Z
You new spectrogram looks good to me now! See the added paragraph in my response.
Noil
CC BY-SA 4.0
2022-06-23T14:24:31.777Z
2022-06-24T09:14:13.120Z
2022-06-24T09:14:13.120Z
Noil
<p>As an alternative to actually filtering your data, have you considered just truncating your spectrograms? If your end goal is to feed this into a machine learning model, I think that this sounds like a lot of work just to give the model a dataset with a large region of &quot;no data&quot;. It sounds like what you are hoping for is spectrograms that look similar to <a href="https://i.sstatic.net/gbnMh.png" rel="nofollow noreferrer">@B. Thomas' second image</a>, but if that's the case then the entire blue region is not going to add any value to a machine learning model if <em>all</em> of your images have that same blue region. You should get equivalent results by just giving it spectrograms that all have been truncated at that same frequency value, since all the information in the image is below that frequency value. This also has the nice side effect of reducing the size of your dataset.</p>
<p>On the other hand, I think that by removing the harmonics from your spectrograms you are potentially losing a signal that a machine learning model could pick up on. You mention that you are worried about other signals in higher frequencies biasing your model results, but as long as your training dataset is large enough this shouldn't really be a problem. Unless you have a higher frequency sound that is consistently present with one type of call and consistently absent with other types of calls (which would be interesting to find out!) then it should all wash out as &quot;noise&quot; from the model's perspective.</p>

CC BY-SA 4.0
2022-10-17T06:59:27.077Z
what about down-sampling the recordings to 10 kHz? This would automatically make spectrograms that are truncated to 5 kHz... would that be a solution and if not, why?
lframond
CC BY-SA 4.0
2022-11-01T19:02:19.370Z
@lframond yes, that can also work but you need to make sure you apply the appropriate filter before downsampling to make sure your results do not have any aliasing. Just adds extra processing steps
Taiki Sakai
CC BY-SA 4.0
2022-06-27T07:42:57.067Z
Thanks for this! Truncating the spectogram is actually what I originally wanted to do but I could not find how to do it, either on Raven or Audition. Do you have a link to a tutorial or something that could help? I'll think about your comment on the harmonics, thank you for this
Potichien
CC BY-SA 4.0
2022-06-28T00:07:14.473Z
I'm not sure if you can do it in something like Raven or Audition, but it should be very easy to do in whatever programming language you are using for your machine learning model. You'll need to have the spectrograms as a matrix at some point (either by creating it from the waveform or reading it from an image), so you can just subset that matrix for only the rows with frequencies you are interested in
Taiki Sakai
CC BY-SA 4.0
2022-06-30T14:41:28.450Z
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Community
CC BY-SA 4.0
2022-06-24T22:49:38.507Z
2022-10-15T21:11:54.783Z
2022-10-15T21:11:54.783Z
Taiki Sakai
<p>I have recorded animal calls in the wild, and I have lots of background noises (bird calls, cicadas etc.). Since my animal calls are quite low-pitched, I don't need the upper part of my spectrograms to conduct my acoustic analyses: I actually think that it can bias the results of my machine learning algorithm.</p>
<p>I have tried to remove all frequencies above 5KHz: Since I have a large dataset, I used batch filtering from Adobe Audition (Scientific Filter of Butterworth type) and Raven (Bandpass filter). For a few vocalizations, I do not manage to completely remove all upper frequencies (it seems to be the case for louder vocalizations, I think...).</p>
<p>Here is an example with a loud call, this one:
<a href="https://i.sstatic.net/mRSMH.png" rel="noreferrer"><img src="https://i.sstatic.net/mRSMH.png" alt="enter image description here" /></a></p>
<p>On the image below, we can see that, for the beginning of the call, the filter (batch bandpass from 0 to 5000 Hz with Raven) works quite well, but it does not in the loudest part: it leaves some harmonics in the middle section.</p>
<p><a href="https://i.sstatic.net/j1d2r.png" rel="noreferrer"><img src="https://i.sstatic.net/j1d2r.png" alt="enter image description here" /></a></p>
<p>Do you know why I have this result? Do you know a software or technic that could help me to completely remove these frequencies?</p>
<p>Many thanks in advance!</p>
<p>EDIT: Thanks to Noil's comment, I realized that I have different results in Raven when I batch filter my folder of vocalizations or when I filter them one by one. Here is the same call as above, filtered with the same configurations (bandpass from 0 to 5000 Hz) but not in a batch process:</p>
<p><a href="https://i.sstatic.net/pfaxu.png" rel="noreferrer"><img src="https://i.sstatic.net/pfaxu.png" alt="enter image description here" /></a></p>
<p>It's still not perfect, but way better...
Any idea about why the Raven batch processing has weird results?</p>
<p>EDIT 2: I have an answer! The calls that were not correctly filtered were slightly clipped, which probably messed with the batch filter. I have thus removed them from the dataset.</p>

CC BY-SA 4.0
2022-06-23T18:08:58.543Z
I'd be interested to know what program you are using for the analysis? I use R and the functions I use to extract features (specan and mfcc_stats in the warlbeR package) allow you to set the frequency range you want.  Otherwise in Raven you can use a bandpass filter to remove any frequency ranges you don't want.
TomCLewis
CC BY-SA 4.0
2022-06-23T18:50:33.757Z
thanks for the update edit - I'll reach out to Raven support (who have joined this site) and see if they can't give more insight
selene
CC BY-SA 4.0
2022-06-23T19:27:16.170Z
@potichien could you put in exactly what filter settings you used in Raven?
selene
CC BY-SA 4.0
2022-06-23T21:37:07.237Z
Spectrograms can be useful for quick checks - though I'm always a bit concerned as some programs have very large dynamic ranges (60-80 dB), that are set relative to the maximum 'pixel' value. This means, even after heavy filtering it may appear like the high-frequency content is still 'lingering' around, even though most of it is gone. Have you tried looking at the power spectrum of the signals before/after filtering to check if things are as expected?
Thejasvi
CC BY-SA 4.0
2022-06-24T13:06:11.797Z
Thank you very much @selene, I have edited the question! (I used a bandpass filter, from 0 to 5000 Hz)
Potichien
CC BY-SA 4.0
2022-06-24T13:20:53.920Z
Thank you @Thejasvi, so with the power spectrum, energy has drastically reduced above 5000 Hz but we can still see the harmonics, like on the spectrogram.
BUT this made me realise that the original call is clipped, i.e. it was too loud for the mic. Could it be the problem? I see here (https://www.wildlifeacoustics.com/glossary/clipping) that it can distord harmonics!
Potichien
<raven><filter>
How to completely remove upper frequencies from a vocalization?
# How to completely remove upper frequencies from a vocalization?

(Asked by: username_0 on 2022-06-23)

I have recorded animal calls in the wild, and I have lots of background noises (bird calls, cicadas etc.). Since my animal calls are quite low-pitched, I don't need the upper part of my spectrograms to conduct my acoustic analyses: I actually think that it can bias the results of my machine learning algorithm.

I have tried to remove all frequencies above 5KHz: Since I have a large dataset, I used batch filtering from Adobe Audition (Scientific Filter of Butterworth type) and Raven (Bandpass filter). For a few vocalizations, I do not manage to completely remove all upper frequencies (it seems to be the case for louder vocalizations, I think...).

Here is an example with a loud call, this one:
[![enter image description here](https://i.sstatic.net/mRSMH.png)](https://i.sstatic.net/mRSMH.png)

On the image below, we can see that, for the beginning of the call, the filter (batch bandpass from 0 to 5000 Hz with Raven) works quite well, but it does not in the loudest part: it leaves some harmonics in the middle section.

[![enter image description here](https://i.sstatic.net/j1d2r.png)](https://i.sstatic.net/j1d2r.png)

Do you know why I have this result? Do you know a software or technic that could help me to completely remove these frequencies?

Many thanks in advance!

EDIT: Thanks to username_5's comment, I realized that I have different results in Raven when I batch filter my folder of vocalizations or when I filter them one by one. Here is the same call as above, filtered with the same configurations (bandpass from 0 to 5000 Hz) but not in a batch process:

[![enter image description here](https://i.sstatic.net/pfaxu.png)](https://i.sstatic.net/pfaxu.png)

It's still not perfect, but way better...
Any idea about why the Raven batch processing has weird results?

EDIT 2: I have an answer! The calls that were not correctly filtered were slightly clipped, which probably messed with the batch filter. I have thus removed them from the dataset.

**Tags:** raven, filter

> **Comments:**
> **username_1**: I'd be interested to know what program you are using for the analysis? I use R and the functions I use to extract features (specan and mfcc_stats in the warlbeR package) allow you to set the frequency range you want.  Otherwise in Raven you can use a bandpass filter to remove any frequency ranges you don't want.  
> **username_2**: thanks for the update edit - I'll reach out to Raven support (who have joined this site) and see if they can't give more insight  
> **username_2**: @username_0 could you put in exactly what filter settings you used in Raven?  
> **username_3**: Spectrograms can be useful for quick checks - though I'm always a bit concerned as some programs have very large dynamic ranges (60-80 dB), that are set relative to the maximum 'pixel' value. This means, even after heavy filtering it may appear like the high-frequency content is still 'lingering' around, even though most of it is gone. Have you tried looking at the power spectrum of the signals before/after filtering to check if things are as expected?  
> **username_0**: Thank you very much @username_2, I have edited the question! (I used a bandpass filter, from 0 to 5000 Hz)  
> **username_0**: Thank you @username_3, so with the power spectrum, energy has drastically reduced above 5000 Hz but we can still see the harmonics, like on the spectrogram. BUT this made me realise that the original call is clipped, i.e. it was too loud for the mic. Could it be the problem? I see here (https://www.wildlifeacoustics.com/glossary/clipping) that it can distord harmonics!  

---

## 3 answers

### Answer by username_6 on 2022-06-24. Score: 6 | Accepted answer

As an alternative to actually filtering your data, have you considered just truncating your spectrograms? If your end goal is to feed this into a machine learning model, I think that this sounds like a lot of work just to give the model a dataset with a large region of "no data". It sounds like what you are hoping for is spectrograms that look similar to [@username_4' second image](https://i.sstatic.net/gbnMh.png), but if that's the case then the entire blue region is not going to add any value to a machine learning model if *all* of your images have that same blue region. You should get equivalent results by just giving it spectrograms that all have been truncated at that same frequency value, since all the information in the image is below that frequency value. This also has the nice side effect of reducing the size of your dataset.

On the other hand, I think that by removing the harmonics from your spectrograms you are potentially losing a signal that a machine learning model could pick up on. You mention that you are worried about other signals in higher frequencies biasing your model results, but as long as your training dataset is large enough this shouldn't really be a problem. Unless you have a higher frequency sound that is consistently present with one type of call and consistently absent with other types of calls (which would be interesting to find out!) then it should all wash out as "noise" from the model's perspective.

> **Comments:**
> **username_0**: Thanks for this! Truncating the spectogram is actually what I originally wanted to do but I could not find how to do it, either on Raven or Audition. Do you have a link to a tutorial or something that could help? I'll think about your comment on the harmonics, thank you for this  
> **username_6**: I'm not sure if you can do it in something like Raven or Audition, but it should be very easy to do in whatever programming language you are using for your machine learning model. You'll need to have the spectrograms as a matrix at some point (either by creating it from the waveform or reading it from an image), so you can just subset that matrix for only the rows with frequencies you are interested in  
> **username_8**: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).  
> **username_7**: what about down-sampling the recordings to 10 kHz? This would automatically make spectrograms that are truncated to 5 kHz... would that be a solution and if not, why?  
> **username_6**: @username_7 yes, that can also work but you need to make sure you apply the appropriate filter before downsampling to make sure your results do not have any aliasing. Just adds extra processing steps  

---

### Answer by username_4 on 2022-06-23. Score: 8

The bandpass filter in Raven uses a Kaiser Window FIR filter, which has a very high stop band attenuation (100dB), and a very rapid transition from pass-band to stop-band. This is very good for completely removing certain frequencies.

A Butterworth filter can usually be configured with an order, the higher the order, the more attenuation you will get. If the order is not configurable, as @username_5 mentioned you can repeat the filter operation until you get the desired attenuation.

A bandpass filter can be used as a lowpass if the lower limit is 0 Hz.
I'm not familiar with Audition, but in Raven using a bandpass filter usually gives you something like this:

Original signal:

[![original signal](https://i.sstatic.net/tByuN.png)](https://i.sstatic.net/tByuN.png)

And with a bandpass with a high limit of 1kHz:[![filtered](https://i.sstatic.net/gbnMh.png)](https://i.sstatic.net/gbnMh.png)

> **Comments:**
> **username_3**: Clear answer on the effect of steep filtering. As mentioned in previous comments/answers - could you double check that the spectrogram color bar has the same mapping (e.g. set the color bar manually or to be fixed to a particular range of values?)  

---

### Answer by username_5 on 2022-06-23. Score: 8

To remove the content above a given frequency, you should use a "low-pass filter".

From your spectrogram, it seems that you applied a low-pass filter on the first part of the signal only. Are you sure you selected the whole signal before applying the filter?

The filtering process just removes a given amount of energy (e.g. -3 dB or -3 dB per octave) on a particular frequency band (in your case above a given frequency). Then applying 1 filter might not be enough for the application you require. You can reiterate the filtering until you have reached the amount of filtered energy that suits you.

---

**EDIT:** The last spectrogram you added (after you edited your question) looks good to me.

* Don't forget that the color scale is in dB and depends on the default range mapping: it can look like there are still a good amount of energy (i.e. bright color) while it can actually be negligible for your application.
* Especially, the vertical yellow band that remains in your higher frequency range are not likely an artifact of the filtering, it just means that the energy was initially greater there than in the background. These vertical bands still look far less loud than your low-frequency range; but check the color scale.

> **Comments:**
> **username_0**: Thank you for this! Interestingly, you are right, it seems that the batch filtering only worked on the beginning of the call. I have updated the question to add more details!  
> **username_5**: You new spectrogram looks good to me now! See the added paragraph in my response.  

---

