0

I've splited an audio file into three segment pieces, then create spectogram bitmap image from each piece using BASS.net library. BASS.net has CreateSpectrum3DVoicePrint method to do this.

public bool CreateSpectrum3DVoicePrint(
    int channel,
    Graphics g,
    Rectangle clipRectangle,
    Color color1,
    Color color2,
    int pos,
    bool linear,
    bool fullSpectrum
)

The method will generate a spectogram image. But in my case, I've to know:

  1. What is 2 Color parameter in the CreateSpectrum3DVoicePrint method means?
  2. How the method draw the Frequency & Amplitude using this method, for example: my spectogram bitmap output image's height = 100, Audio BitRate = 44100hz
  3. Which point draws start 0hz Freq, from top or bottom of image?

specto_output.bmp

Vinno
  • 33
  • 1
  • 6
  • Yes, I know that basically spectogram is a STFT based, Frequency Time axis, etc. But the link that you provided was Mathlab used. It has different method and output with Bass.net and C# (see my output pic). – Vinno Oct 24 '15 at 03:06

1 Answers1

1
  1. In a typical spectrogram you would be incrementing the x-position over time and at new timer interval you'd move to the right by one pixel and over write the data that was already there. And then once you reach the right edge of the graph you go back to the beginning. The color2 parameter will set the color for a line that will be drawn at the current position to depict where you are.

  2. Frequency is represented by the position along the y-axis and amplitude is represented by a color. In your example, the blue areas indicate low amplitude. Take a look at a spectrum. Now imagine you are looking down on this from the top so that it is a straight line. Now rotate it so that the line is vertical and map the values to a color such that the peaks are brighter and the lower levels are darker. That's what each vertical line in the spectrogram is.

enter image description here

  1. My bet would be that 0 Hz is at the top of the image - just a guess since there is typically more energy in lower frequencies for things like voice and music.
jaket
  • 9,140
  • 2
  • 25
  • 44
  • Yes, I guess so, that top of the image is 0Hz. I wonder to know if there is more good docs for this CreateSpectrum3DVoicePrint method in Bass.net. – Vinno Oct 24 '15 at 03:11