Showing posts with label Audacity. Show all posts
Showing posts with label Audacity. Show all posts

Saturday, 11 March 2017

Nocturnal bird recording - how I do it

If this appears familiar to anyone, it'll be because it is largely lifted from a thread on Birdforum that I started last year. With my first recording session of 2017 completed a couple of nights ago, it's time to get the ball rolling with getting some details onto here.

A few recording sessions in September last year revealed a few interesting results, such as greenshank and dunlin, goldcrest, and regular passage of terns (both Sandwich and common). I'm looking forward to seeing how numbers of night migrants and variety of species changes through the year.

My kit:

I'm using a Roland R5 recorder attached to a Rode NTG2 directional microphone. I use Audacity to visually scan through a spectogram of my recording, to try and isolate calls. I didn't alter the settings from what I'd normally have it on for standard field use, which means it's probably set to a fairly high resolution, and I could probably reduce the size of my sound files by dropping that a bit. I can't remember what the settings are exactly, but you should definitely make sure you're recording in MP3 rather than WAV, as an MP3 file is going to be a lot smaller. Not sure what size the card is, but I can record at least 1.07 GB and not run out of space.

The only issue with file size for me is that it made Audacity a bit clunky when I had 1 GB open in it. When I've analysed the recording, I archive all of the identifiable stuff I get but I dont keep every recording so a nights recording of 1 GB will reduce down to just over 1 minute of useable stuff in the end.

My set up:

While some people leave lovely parabolic reflectors set on tripods, pointing skyward over night, I have a slightly different set up. We have a shared garden and in this neighbourhood there is no way I am going to leave anything worth money accessible in the garden! Instead, I get an old handbag and place the mic in it, pointing upward. I hang this out of the window, trying to make sure the mic is pointing upward but away from the house a little (otherwise I'd just be getting crystal clear recordings of the gutter). I've bought a long cable so the recorder can easily be kept on the inside of the window while it is running. One advantage of this is that the mic probably gets a little more shelter from wind than if it was sitting in the middle of the garden.  

My location:

I'm based on the outskirts of Aberdeen, next to the harbour - a surprisingly quiet place all things considered.  It's certainly a decent place for flyover birds in the day and I've had whimbrels, whoopers, pinkfeet etc going over during the night. I do record the odd bit of ambient noise, traffic, trains, drunk people singing etc, but not enough to hinder hearing more interesting things.

My analysis:

This is the time consuming but fun bit. Once the recording has opened in Audacity (this can take a while) I reduce the size of the file by splitting the stereo track into two mono tracks and deleting one of them. I then zoom in to the recording (magnifying glass button in the toolbar) so that the screen width covers about 5 minutes worth of time - the x axis of the spectogram. Be aware that with a big file, the zooming in will not respond immediately so you might have to wait ten seconds or so for Audacity to respond. And then I press play! Obviously I'm not going to sit there and listen to 7 hours worth of recording, so I skip through looking for obvious noises. You can click anywhere in the spectogram, and pressing play will start your recording playing at that point. If I have a window that is obviously blank, I just click at the far right of the screen and press play - a few seconds later the window will have scrolled onto a new part of the recording and I can start looking for obvious visual signals again. While the file is playing, you can also skip through both forward and back, using the cursor. All the while I'm listening to whats going on through headphones, so my other half can watch 'Eastenders' in peace... 

I probably miss a few birds like this, especially early in the morning when the local robins start singing, and the sonogram is full of 'visual signals' that make finding night migrants a lot more difficult. However, I've found some good stuff using this method, including a huge surprise on my first session this year - A coot flying over at about 00:50! I've only seen two coots locally before so it was well worth all of the sifting! I'm sure there are plenty of other surprises in store too.





A coot over the house at night. 

Monday, 20 February 2017

Refining your sonograms with Window size and type

Tucked away in the Audacity menu, hiding in the preferences tab, are two ways of refining the appearance of your sonograms. These involve changing the size of the window (it doesn't actually change the size of the window as it appears on the screen) or changing the window type. This changes the way in which the sonogram is generated and can therefore have some effect on its appearance. 

Changing the window size effects how much frequency detail is revealed. The general rule is the larger the number, the more frequency detail one gets at lower frequencies. The payoff is that there is less temporal resolution, but I find that this is less critical when viewing sonograms of birdcalls. How the window size effects the appearance of the sonogram can be illustrated nicely with this rather poor recording of a distant tawny owl (that has been ‘cleaned’ with a bit of noise reduction). To alter the size, open the 'Audacity' dropdown and select 'Preferences'. Select the 'Spectograms' tab, then, experiment with the window size options in the relevant dropdown.







The first sonogram shows a sonogram with a window size of 512, and the second with a window size of 2048 - see how the frequency detail is so much easier on the eye at 2048.

Changing the window type usually has a less radical effect on how your sonogram appears, but it can be worthwhile experimenting with different options if you have a sonogram that could look better. Again, choose the 'Prefefences' from the 'Audacity' menu, and experiment with the different window types in the 'Spectograms tab. Here, this firecrest call is displayed with the default window type, which is called ‘Rectangular’. 





Not very helpful! Changing it to the second option, called Bartlett, helps thins a little, but still, doesn’t really produce anything that you can really work with. 


Choosing the option called Gaussian(a=4.5) however, produces something much more useful. I don’t know of any hard and fast rules regarding how choosing different window types might improve your sonograms, so it’s always worth just experimenting with a few options in order to get the best results.


Wednesday, 25 January 2017

Using the Equalisation tool

This tool is a great for reducing the levels of unwanted noise and enhancing the levels of the ones you want to keep, and it’s a great way to target certain frequencies. Again, it’s found in the Effects menu. 

Here I’m using a sonogram generated from a recording of a Siberian chiffchaff that I made with my iPhone. I’d left my recording kit at home as it was raining. It’s always the way…you find something interesting when you’re least prepared for it! Note how much darker the sonogram appear than in previous examples. I don’t know why for sure, but I suspect that this is because the mic is picking up more noise - not because it is more sensitive, but because it is not directional, so as well as the bird noise that you are trying to record, it’s also picking up background noise from all directions. 




Before you do anything else, make sure you know roughly what frequencies you want to keep/enhance. Open up the Equalisation tool and select the radial button for ‘Graphic’ towards the bottom of the window, so that it looks like the picture below. Do you remember when they made Walkmans better by adding a graphic equaliser? Well this is exactly the same, but a little more sophisticated than just allowing you to adjust the bass and the treble etc. If the blue line does not cross the graph at 0 decibels just press ‘Flatten’ to reset it. 

You’ll see that there are a series of sliding scales at the bottom the window that relate to different frequencies (hover the cursor over the button and it will tell you its frequency). It’s now simply a case of decreasing the decibels for the sounds you don't want, and increasing the decibels for the ones you do. The effect this will have on your sonogram will be to make it darker (i.e. more noise) where you have increased the decibels, and paler where you’ve decreased them. Here, I want to keep, or maybe even enhance the area around 5 khz, but reduce the rest. Your sonogram should look something like the picture below.




Now, if you like you can further refine your equalisation by be being a lot more precise in reducing the decibels close to the ones you want to keep (you can see from the graph in one of the images above that I chose quite a bit of leeway around my pretty narrow window of interest of between 4.1 and 4.7 khz).

Alternatively, you can go back to some of the other ways of noise reduction that we’ve looked at already. Here, I used the ‘Noise reduction’ tool from the ‘Effects’ menu to clear up some more unwanted noise.




What we’re left with is a much cleaner recording, but some slightly ‘fuzzy’ looking Sibe chif calls! You can take some of this fuzziness away by going back into the Equalisation tool and reducing the ‘peaks’ you’ve set on the graph, like I’ve done in the picture below. Run this twice and you’ll end up with a nice clean looking sonogram! it will play quietly when you listen to it but you can increase the volume by turning up the ‘gain’ in the box to the left of your sonogram. 








Sunday, 15 January 2017

More ways to remove unwanted noise - Noise reduction and Pass filters

Much of the noise that you’ll want to remove from your recordings will occur across a limited frequency range, so can’t simply be cut out as demonstrated in this post. In this recording of a grey wagtail in flight, you’ll notice that the bottom half of the sonogram (the lower frequencies) is quite dark compared to the upper half (the higher frequencies). I made this recording not far from a busy road, so much of the low frequency noise will be that of cars passing by in the background.


There are three ways to reduce or eliminate this sort of noise from a recording, and all use features in the Effect menu. The tools to use are: Noise reduction, Pass filters, and the Equalisation tool. 

Noise reduction

Highlight a part of your recording that contains the noise you want to remove, but does not contain any of the important stuff you want to retain. Then select Noise reduction from the Effect menu. In the window that appears, click on the ‘get noise profile’ button.




When this is done, highlight the whole of your recording (click and drag) and then return to the Effect menu, selecting Noise reduction again. This time, just press OK and Audacity will reduce the sounds that you ‘profiled’ and reduce them across the whole recording. 



You will see in the image below that the darker area at the bottom of the sonogram has been greatly reduced.



Pass Filter

To reduce unwanted low frequencies, as with this example, choose the High pass filter from the Effect menu. 


A window will appear, and in the box labelled ‘Frequency’, type the frequency below which you want to reduce the levels. In this example I’ve typed 5000, as this is roughly where the background noise disappears, and crucially, is lower than the lowest frequency shown by the calls you’re interested in. Press OK and the High pass filter will reduce much of your unwanted noise.



You’ll be able to hear the difference in your recordings of course, as well as seeing it on the sonograms. Beware however that over editing of this sort can produce rather unnatural sounding recordings - with too much editing of this nature making recordings sound down right unpleasant. It's an effective way of cleaning up sonograms though, so if you're submitting a sonogram and a recording for a description, for instance, consider 'cleaning' the sonograms but sending a different, less edited r

Tuesday, 3 January 2017

Removing the sounds you don't want

Most of your recordings will feature some sound that you don’t want to keep, and there are several ways to get rid of them.  Some will be sounds you want to eliminate completely. You’ll record dogs barking, people talking, the cable hitting the mic, the clicks caused by a loose connection, and any number of other bits of unwanted noise. You can literally cut these out of your recordings with Audacity. 

At the beginning of this recording of a great tit, you’ll see some broadband (i.e. covering almost all frequencies) sound I made while rummaging around with the mic. I nearly always capture some of this noise as I have my recorder set to record sounds from 2 seconds before I actually press the button. It's set up like this to give me a better chance of getting flyovers or birds that only call once. 

To remove this, highlight the unwanted area by right clicking on the screen and dragging to highlight the area you want to remove. Then, click on the scissors icon - and your unwanted section will be removed. Note that you can only do this across all frequencies - i.e. you can’t highlight within a specific frequency range, only across a specific time period. 





The edited sonogram looks like this


Keep in mind that you’re removing some time from your recording, so the gaps between calls or song phrases will be reduced. If this needs to be addressed, you can simply copy an area from your recording of a similar length, and paste it into the right place. In my recording I’ve selected a section containing a ticking robin to maintain roughly the right period between the great tit phrases. To copy, simply select the area you want to copy in the same way you selected the section to remove. When the required area is highlighted, choose COPY from the edit menu (top of the screen). Then you just need to click where you want to insert the copied section, return to the edit menu, and hit PASTE.

EDIT - the good people at Xeno-Canto have been in touch and suggested that inserting noise from elsewhere in your recording might not be such a good idea - and have recommended adding in a silent section of the correct length instead.


Sunday, 1 January 2017

Audacity - the basics

There are plenty of options for birders who want to analyse and edit sound recordings, and produce sonograms depicting what they’ve heard. A decent selection can be found here and if anyone feels like experimenting we’d love to hear about what you’ve used and whether it was any good. There are two that seem to be favourites among birders, and these are Audacity and Raven. Both are free, safe to download, and are easy enough to pick up.

Audacity can be downloaded from here: http://www.audacityteam.org/  and the installation process is fairly simple - I managed it and I’m not particularly techy at all. On my mac it was a simple drag and drop followed by opening the app in my applications folder. For mac at least there are very useful instructions on the Audacity download page, and there’s no reason to expect them not to be there for Windows, Linux, or any other operating system.

Once Audacity is installed, open it up. You’ll be met with a blank grey screen with a few tool bars and menu lists at the top. It looks like a lot to take in but hopefully we’ll cover the most useful aspects of using it here, and by the time you’ve played around with it a few times, you’ll probably be confident enough to experiment yourself.

Before we get started with that though, a few boring words on file types. Your recording device will probably record sound into either .WAV or .MP3 files, or possibly something else if you've used a mobile phone (iPhones create .m4a files for example, which Audacity handles very nicely). WAV files contain the most detail but as a consequence are much bigger then MP3 - so if you want to store lots of files, email or upload your sounds anywhere, MP3 is the best bet (the lower quality is pretty much undetectable). Keep in mind that Xeno-Canto will not accept .WAV files, only MP3. So, in short, set your recorder to record MP3 files. However, Audacity cannot create MP3s directly, but it does so very effectively with the help of a plug-in called LAME. All this to say that if you want to edit your sounds and save the edited versions as MP3s then you’ll need to install this plug-in. Please don't be put off by that - it’s all very simple and Audacity will prompt you when the time comes. 

So, back to the blank grey screen. You’ve been out and recorded what you think may well have been a Siberian chiffchaff but you want to check the sonogram. Transfer your recording to your computer and save it with an appropriate name, in a place you’ll remember how to browse to. Go to the FILE dropdown menu in Audacity and choose either OPEN or IMPORT. Browse to your sound file and open - all of a sudden (unless it’s a massive file) your recording should appear in sonogram form, replacing at least some of that blank grey screen. Note - if your file does not appear in sonogram form (it might default to waveform until you tell it not to) open the dropdown highlighted in the second image and select 'spectogram'. You can play your file by hitting the green triangle button in the top left corner, stop it with the yellow square next to that, and zoom in and out of the sonogram using the magnifying glass buttons towards the right hand end of the toolbar. You can also change the shape of the window by clicking on the yellow border around the sonogram and dragging.


If you are recording in stereo you’ll note that your recording appears twice. If you want to make a nice sonogram it’s useful to get rid of one of the tracks, so click on the little black arrow that appear below the play and stop buttons. This opens up a dropdown menu, with an option to Split Stereo to Mono. Choose this option and then get rid of one of the tracks by clicking on the tiny ‘X’ in the top left corner. Once this is done you’ll be left with a single track sonogram that you can zoom in and out of, play, stop, etc. If you wanted to email it to someone or insert it into a description, you can either take a screen grab, or go to the HELP dropdown menu in Audacity, and use one of the screenshot tools.







Your first sonogram, ready to edit or use, looks like this! And unfortunately it's not the hope for Sibe but one of those mysterious 'sweeoo' chiffchaffs. Much more interesting...