Skip to content Skip to navigation

OpenStax_CNX

You are here: Home » Content » Birdcall Identification: Matched Filter Implementation

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • Rice University ELEC 301 Projects

    This module is included inLens: Rice University ELEC 301 Project Lens
    By: Rice University ELEC 301As a part of collection: "ELEC 301 Projects Fall 2008"

    Click the "Rice University ELEC 301 Projects" link to see all content affiliated with them.

Also in these lenses

  • Lens for Engineering

    This module is included inLens: Lens for Engineering
    By: Sidney BurrusAs a part of collection: "ELEC 301 Projects Fall 2008"

    Click the "Lens for Engineering" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.
Download
x

Download module as:

  • PDF
  • EPUB (what's this?)

    What is an EPUB file?

    EPUB is an electronic book format that can be read on a variety of mobile devices.

    Downloading to a reading device

    For detailed instructions on how to download this content's EPUB to your specific device, click the "(what's this?)" link.

  • More downloads ...
Reuse / Edit
x

Module:

Add to a lens
x

Add module to:

Add to Favorites
x

Add module to:

 

Birdcall Identification: Matched Filter Implementation

Module by: Robert LiKamWa. E-mail the author

Summary: This module describes how a matched filter algorithm is used to identify birdcall audio files.

Matched Filter Implementation

Matched Filter

Matched filters do an excellent job of identifying sound samples, so we decided to apply the method here to identify birdcall audio files. A matched filter searches for a sample clip, the filter, within a longer audio recording. Convolution compares the filter to the longer signal at each possible offset. The greater the maximum amplitude of the convolution result, the stronger the match. By having a different filter for each birdcall, we can search an audio file to identify which birdcall it contains.

The matched filter algorithm is as follows:

  1. Reverse the filters in the time-domain.
  2. Normalize the energy of each of the filters.
  3. Convolve each filter with the input signal and take the maximum amplitude of the resulting convolution signals.
  4. The filter that gives us the greatest maximum value indicates which birdcall the signal contains.
Figure 1
Figure 1 (graphics1.jpg)

Filter Library Creation

Our first step in implementing the matched filter algorithm was to create a library of birdcall filters. To do this, we looked at the spectrograms of a few sample audio files of the same birdcall and selected a portion that looked representative of the call.

Figure 2
Figure 2 (bobcalls.jpg)

For each birdcall, one of the representative audio segments was saved as a filter. Because the first two steps of the above matched filter algorithm affect only the filter library and are independent of the input signal, we reversed the filters and normalized their energy before saving them to wave files.

Matlab Implementation

The following MATLAB script performed our matched filter algorithm. When given a wave file as input, it would tell us how well the audio sample matched against each of the 6 birdcall filters.

Note:

We used circular convolution instead of linear convolution because it computed much faster. MATLAB's built-in cconv function zero-pads the two signals before multiplying their FFTs, generating the convolution result we are looking for.
function result = birdcheck(file)
    [sig, fs, nbits] = wavread(file);
    signal=sig(:,1);
    signal=signal/max(abs(signal));
    filters{1}=wavread('filters/bob.wav');
    filters{2}=wavread('filters/lt.wav');
    filters{3}=wavread('filters/lw.wav');
    filters{4}=wavread('filters/pygmy.wav');
    filters{5}=wavread('filters/red.wav');
    filters{6}=wavread('filters/redcry.wav');
    for i=1:6
      filter=filters{i};
      result(i) = max(abs(cconv(signal,filter(end:-1:1))));
    end 
  end
    

The script was able to correctly identify several birdcalls. It did fail to correctly identify four cases in two categories:

  1. Two of our loon tremolo files registered as pygmy owl common songs.
  2. Two of our red-tailed hawk shriek files registered as red-tailed hawk cries.

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Reuse / Edit:

Reuse or edit module (?)

Check out and edit

If you have permission to edit this content, using the "Reuse / Edit" action will allow you to check the content out into your Personal Workspace or a shared Workgroup and then make your edits.

Derive a copy

If you don't have permission to edit the content, you can still use "Reuse / Edit" to adapt the content by creating a derived copy of it and then editing and publishing the copy.