1

I was using a tool in bash call spectgen to calculate the amplitude of a wav file. The description of spectgen is available here: http://festvox.org/docs/speech_tools-1.2.0/x1717.htm#AEN1772.

What I'd like to get is a list of amplitude values according to the time. So the command I run is:

spectgen A_wav_filename.wav -otype xgraph -raw -shift 0.05 -o Output_file

And then I got a file with such format:

"track_0"
0.001   11.6221
0.002   15.3733
... ...
"track_1"
0.001   13.6334
0.002   15.4525
... ...
... ...
"track_127"
0.001   10.4165
0.002   12.1524

I'm not sure about what the track actually means. As in the description, it plots a 3-D graph based on time and channels and it's amplitude. So the first column is time for sure, and second should be the amplitude I think? I am guessing that the "track" means each channel? If it does, then how to calculate the amplitude value for each time point? Thanks a lot in advance.

Qingshan Zhang
  • 245
  • 1
  • 3
  • 12
  • Your link says: _spectgen is used to create spectrograms, which are 3d plots of amplitude against time and frequency. Spectgen takes a waveform and produces a track, where each channel represents one frequency bin. By default spectgen produces a "wide-band" spectrogram, that is one with high time resolution and low frequency resolution. "Narrow-band" spectrograms can be produced by using the -shift and -lengt options_ – criticalfix Aug 05 '13 at 20:04
  • So I take that to mean that each track_nnn is a frequency bin, and it's telling you the amplitude at a given time in a given frequency bin. If you're asking for an overall amplitude, it sounds like you don't want to have it broken down by freqency. Try to make it use a single frequency bin covering the whole range, e.g., 0 Hz to 20 kHz. – criticalfix Aug 05 '13 at 20:07
  • Now I tried to set the number of channels to 1 (by using the flag -n in the tool) but seems it still splits into 128 channels.. I also added the flag -c to set with 0 but didn't work either..The output is always splitted into 128 tracks. – Qingshan Zhang Aug 06 '13 at 09:36
  • Well, maybe this isn't the tool you want to use for this purpose. Maybe it doesn't do what you need. I assume you tried the -shift and -lengt options they talk about to change the size of the frequency bands? Are there any other options that might work? – criticalfix Aug 06 '13 at 13:26
  • hmm, I guess maybe I do need to change some other tool to get the amplitude. Earlier I thought there's a formula for calculating the amplitude by these separated frequency bins. Will look for some other tool, and thanks so much for the suggestion :) – Qingshan Zhang Aug 07 '13 at 12:08

0 Answers0