Back to: Anabat Contents, Home
The Flatness Display was introduced in Analook version 4.9f as an alternative display of bat call characteristics, accessible by pressing Ctrl-F4. The notes in this page refer to the manifestation of the display in version 4.9g, where it has been enhanced slightly.
The Flatness Display produces a graph of the time spent by a bat call in each frequency band, or the number of cycles in the original signal in each frequency band. The frequency bands are defined by the rows of pixels along the vertical axis of the graph, and exactly match the frequencies being displayed in the normal ZCA frequency vs time graph on the left side of the screen. The time or number of cycles being spent in a given frequency band are an indication of the inverse of the slope of the call as it passes through that frequency band, hence the term Flatness. Higher values in the Flatness Display indicate lower values of slope in the call, although the Flatness Display makes no distinction between positive and negative slopes.
If you wanted to describe a bat call to someone else, probably the first thing you would like to convey is the frequency of that bat call. Since most bat calls change in frequency throughout the duration of the call, which frequency would you refer to? It would seem a bit pointless to refer to the maximum frequency, since any perception of that parameter will be strongly influenced by the distance between observer and bat. The same comment applies to minimum frequency, although more often it does correspond to something more meaningful. I'm sure most people with experience of bat calls will agree that a more useful parameter to be used as an indicator of frequency would be something along the lines of the frequency at which the call spends most time, or where it is loudest.
Traditionally, the parameter used as an indicator of frequency has been Fpeak, or the frequency of the call at the point where the amplitude is greatest. There are various ways in which Fpeak has been calculated, but usually it involves producing a power spectrum across a whole bat call and taking the frequency at the point where the power spectrum reaches its greatest value. Fpeak has not always been used in a consistent way, and it hasn't always been calculated properly. It should be determined using a single FFT slice across the entire call without any windowing function (or a rectangular window covering the whole slice). If a windowing function is used, this will make Fpeak depend on where in the window the call is placed, and it will introduce a variable which has nothing to do with the bat call but is an artifact of the measurement process.
Fpeak seems simple to measure and it seems to have a reasonable biological significance. It seems a reasonable assumption that the frequency where a bat puts most energy will somehow mean something, and it will also generally correspond to the frequency where the bat will detect an echo from the greatest distance. However, Fpeak has some disadvantages as well. Firstly, and most importantly, it requires the use of spectral analysis, which means it can't be used by Anabat users. But even for those who feel they must torture themselves with spectral analysis, Fpeak has some problems. In general, Fpeak occurs somewhere in the part of a call with the lowest slope, but there doesn't seem to be much consistency about just where. To make matters worse, many bat calls fall into a category where Fpeak doesn't really mean anything, since the call ramps up in amplitude during the initial downsweep and then remains at essentially the same amplitude for an extended period of time until the final ramp down. In such a case, the position of Fpeak is essentially arbitrary - we are forcing the call into having a peak even where there is no peak.
From an Anabat user's point of view, Fpeak has no value, since we can't measure it. The usual parameter to use as an indicator of frequency is therefore the characteristic frequency, Fc. Fc is the frequency at the right hand end of the flattest part of a call, and as such, it avoids the initial downsweep and any droop off in frequency at the end of the call. Fc shows a lot more consistency than Fpeak, showing lower variability within a species or within the calls of an individual. Partly, this is because Fc is inextricably linked to the shape of a call (the shape of its frequency vs time graph). If the calls are the same shape, Fc will always be at the same place, a feature not shown consistently by Fpeak. Fc is readily available to those who use spectral analysis, although it has rarely been used by them, mainly, I suspect, because Fpeak is so easy to measure.
Usually, the output of a frequency division bat detector will be analysed using ZCA. Why waste time and effort running spectral analysis on the output of a detector whose output information is entirely contained in the ZCA display? I discovered that some people in Australia were actually committing this heresy, and I spoke to Norm McKenzie in Western Australia about his use of the technique. His approach has been detailed in Bullen RD and McKenzie NL, 2002 (Differentiating Western Australian Nyctophilus echolocation calls. Australian Mammalogy 23: 89-93). I don't wish to convey here endorsement of their technique or the conclusions in that paper, but the approach sounded interesting and it made me wonder if there might be some way to achieve a similar result by using the data already available in the Analook display, without the messiness of the Fast Fourier Transform.
At this point, I do wish to make one thing very clear. Some people might get the impression from reading the paper cited above that spectral analysis of Anabat output actually reveals some hidden information which isn't revealed using ZCA. This is absolutely untrue. There is NO hidden information in the Anabat output, and anything extra which is revealed using spectral analysis is pure artifact. To give an example, spectral analysis of Anabat output will reveal a signal rich in odd-numbered harmonics. But these harmonics did not come from the bat in any sense at all. They were produced as a pure artifact of the fact that the Anabat output is a square wave. This has no bearing on anything the bat has done. There is NO hidden amplitude information buried in the Anabat output that has anything at all to do with anything the bat did. Any amplitude information in the Anabat output is entirely artifact resulting from the way the Anabat output signal has been processed and/or stored. The ONLY information of any value in the Anabat output is the time between zero-crossings, and this information is extracted completely by the ZCA process.
Nevertheless, a power spectrum of Anabat output does produce a different view of the data, and because I felt that view might have some merit, I developed the Flatness Display so I could play around with it and see if it helped in any way. So here I want to explain how it works and how to use it, and let others decide for themselves how useful it might be.
In this section, I explain how the Flatness Display works, and how it relates to the FFT based power spectrum which it mimics.
To make a power spectrum, you run a single FFT transform across the sampled waveform of the Anabat output corresponding to a single bat call. This transform results in dividing the frequencies present in the signal into a number of frequency "bins", and then outputting a graph showing how the amplitude of the signal is divided amongst those frequency bins. In essence, what you have done is taken the signal and played it simultaneously through a large number of filters, each tuned to a different frequency range. The frequencies of these filters are called orthogonal, because they are all mutually exclusive - no signal component appearing in any particular filter is present in any other filter - they are all independent. The FFT itself is an extremely clever and unbelievably efficient way of doing this mathematically in a single pass. It is a masterpiece of human intelligence.
In a power spectrum, there is just a single value output for each frequency, representing, in effect, how much energy is contained in the signal at that frequency. The FFT effectively integrates the amplitudes across the whole slice (the time interval which is being examined by the FFT). When you perform an FFT on Anabat output, there is no amplitude information, since the Anabat output is a square wave. So the net effect of the FFT is to produce an output for each frequency which is proportional to the time which the signal spends at that frequency. This is a bit of an oversimplification, since there are a number of possible ways of representing the FFT output, but the principal is there.
The Analook display is just a graph of frequency vs time. Furthermore, it is already quantised, that is, broken into a series of frequency bins, by the process of mapping the frequency values onto the rows of pixels which make up the display. Therefore, it is a simple matter to calculate how much time the bat call spends passing through each of these frequency bins (or bands), by simple linear interpolation between any two dots on the screen. In practice, some assumption must be made as to how the frequencies change in time between any two dots. One assumption could be that the frequency changes linearly with respect to time, but I actually used the assumption that the period (the reciprocal of frequency) changes linearly with time. The difference is of no consequence within a bat call, but I found the linear period assumption produces a nicer display when showing the results of having two consecutive dots at very different frequencies, as can happen when certain types of noise are being displayed. It was a purely cosmetic decision.
The net result of these surprisingly simple calculations is that you end up with an array of values which represent the time spent in each frequency band, accumulated over the whole bat call. These values are then scanned for the largest value (ie the frequency for which the time is greatest) and then the values are graphed by mapping them so the largest value extends right across the width of the Flatness Display. In practice, two options are available - display of times or cycles. The cycles display is derived very simply by multiplying the accumulated time values by the midpoint frequency of each frequency band. The output value then becomes the number of cycles (oscillations) which the original bat call produced in each frequency band. Using the alternative time display, the output values are in milliseconds. Both versions produce a Flatness Display, in which the higher the value, the lower the slope of that part of the original call (ie the lower the rate of change of frequency with time).
You can select the Flatness Display by pressing the "Ctrl-F4" key combination while a bat call or sequence is being displayed on the screen. The resulting Flatness Display can be toggled on and off by pressing the "v" key, in the same way that this toggles the Slope Display.
The Flatness Display occupies the right hand side of the screen, and it makes its calculations based on all of the data points visible on the left side of the screen. To isolate one single call for analysis using this method, use a Real Time display (toggled against Compressed mode using the spacebar) and increase the magnification of the time axis using the function keys until that call is the only signal visible on the left side of the display.
A graph of the selected Flatness function will appear, mapped so it uses the entire width of the display on the horizontal axis. The vertical axis will be frequency, mapped onto the screen exactly the same as the frequency axis on the left hand side of the screen. Along the bottom of the Flatness Display there will be five values. On the right is the frequency represented by the widest peak in the graph, which will correspond to the frequency at which the call/sequence spends most time, or produces most cycles. This value is called Fpz, because of its analogy to Fpeak as derived from a spectral display. Think of it as the peak frequency derived from ZCA.
To the left of the Fpz value is another figure which represents the number of milliseconds (mS) or cycles (c) found within the frequency band represented by the Fpz value. This value will probably be of little use by itself, but it does have some significance in correlating (negatively) with the slope of the call as it passes through the frequency Fpz. It should correlate closely with the Characteristic Slope (Sc) calculated elsewhere in Analook.
Further left are three more values in kHz which represent the widths (in frequency) of the largest peak of the graph at points where the Flatness parameter (time or cycles) is at one half, one quarter and one eighth of its maximum value. Essentially, these values are computed by scanning both ways from the Fpz value until the accumulated parameter (time or cycles) falls to a half, quarter or eighth of its peak value. These values may have some value as indicators of the overall slope and shape of the call. Steep calls will show higher values than shallow or flat calls.
Two options are available by pressing the "Alt-p" key combination. One of these chooses whether times or cycles are displayed as the Flatness parameter. Press "t" to display times and "c" to display cycles.
The other option determines how much smoothing or averaging is applied to the Flatness Display. Three choices are available, selected by pressing the "0", "1" or "2" key. The display will be updated as soon as any of these keys is pressed. To accept the change, press ENTER and to revert to the state in operation before "Alt-p" was pressed, press ESCAPE.
No averaging is chosen when the "0" key is pressed. When the "1" key is pressed, the value stored for each frequency band is the average of three adjacent frequency bands. When the "2" key pressed, averaging is performed over 5 adjacent bands. The effect of averaging is to smooth out the Flatness Display, making it less sensitive to small irregularities in the dot positions of a call, and thus less sensitive to short term signal dropout (which leaves gaps in a call).
In many cases, there will be little difference between using times or cycles as the Flatness Parameter. The cycles display has an inherent bias towards higher frequencies, so peaks at higher frequencies will get more emphasis. In contrast, the times display puts relatively more emphasis on lower frequencies, and might therefore be more susceptible to being influenced by echoes or other noise.
Smoothing of the graph by using averaging will generally be desirable, since it produces a less spiky, erratic display. However, it can sometimes be a little misleading. For example, if examining a Rhinolophus call, the peak will no longer correspond with the maximum frequency, which is where the peak should obviously be. The reason for this is that the frequency which should be Fpz will also be the maximum frequency, so when that frequency band is averaged with those either side of it, it will contain a smaller value than the band below it, which will also contain the value from Fpz. In such a case, it would be better to use no averaging.
In general, then, it might be best not to use averaging when dealing with calls with extended constant frequency components. In such cases, averaging will also be less beneficial anyway, since the peak corresponding with Fpz will be very unambiguous.
The usefulness of Fpz needs to be assessed carefully to see how it compares with Fc as a general indicator of bat call frequency. The Flatness graph does seem to be very sensitive to call shape, and responds a great deal to very subtle changes in slope. On the other hand, it also seems less sensitive to signal dropout which can cause "holes" in the display of a bat call. These would seem to be desirable attributes. The concept of Fc, and the way it is estimated by Analook, make that variable more dependent on gross shape features, while Fpz seems to respond to more subtle shape features. Fpz is also easier to calculate in a consistent manner, although it does suffer from the fact that bat calls often show more than one peak in the Flatness parameter and occasionally a peak which is normally smaller will become the larger. Using a display of times rather than cycles may reduce this tendency, since lower frequencies will be relatively emphasised and the lower peak should therefore tend to be more consistently the larger.
Fpz will be much more closely tied to call shape than Fpeak, since it isn't affected by the amplitude of the signal, just the shape. While the amplitude of a bat call may have some significance in relating to where the bat is putting most energy into a call, it is also readily affected by artifacts and practical experience suggests that it will probably show substantially more variability for a given set of calls than Fpz. Interestingly, Fpz should be readily calculated from full-spectrum recordings, so it might have value as a character which can be used by both spectral analysis and ZCA.
Back to: Anabat Contents, Home