Old 16th March 2005, 13:28   #1
benHc
Junior Member
 
Join Date: Mar 2005
Posts: 1
spectrumdata info

Hi there!

I'm developping a VIS plugin for winamp 5.x
i'm trying to analyze the spectrum data
given by winamp to split the frequencies
into bass,medium and treble (or more)
I have a few question:
1) what range frequencies do represents the spectrumData?
60 hz to 16 000 hz? where can i get this info?
2) the spectrumData scale seems to be linear. i suppose it's more easy to work with a logarithmic scale. How do i convert the spectrumData to my own arrayData with a logarithmic scale?

Thanks you!
benHc is offline   Reply With Quote
Old 17th March 2005, 14:39   #2
eleet-2k2
Forum King
 
eleet-2k2's Avatar
 
Join Date: Aug 2001
Location: Mobil Ave.
Posts: 5,381
Hi benHc.

The human hearing range is from 20Hz to 20kHz, so would it not make sense for the spectral data to be in the same range?

Also, if you want a breakdown of the frequency ranges, I'd say this is how they breakdown (but this is imho and I'm not a sound expert )
Bass: 20Hz - 600 Hz
Midrange: 600 Hz - 12 kHz
Treble: 12 kHz - 20 kHz

"Welcome to the Island of people who know too much."..."Did you really think balloons would stop him?!"
See what I'm listening too.
eleet-2k2 is offline   Reply With Quote
Old 17th March 2005, 15:04   #3
misterkik
Junior Member
 
Join Date: Mar 2005
Posts: 3
if i understand well, there are just a few values for the bass and a lot more for the medium and the treble ? is there a possibility to aquier ther same number of value for the bass, medum and treble ?

tkx,

Kik
misterkik is offline   Reply With Quote
Old 17th March 2005, 18:29   #4
eleet-2k2
Forum King
 
eleet-2k2's Avatar
 
Join Date: Aug 2001
Location: Mobil Ave.
Posts: 5,381
Well you're talking about the Winamp equalizer. The thing about an equalizer can have as many or as few bands of frequencies to control it. For exaple, there are some professional equalizers that have 20+ bands, while Winamp's EQ has 10 bands + preamp.

The bass, midrage and treble frequencies are actually ranges of frequencies (called bands) that vary from 20 Hz - 20kHz (the human hearing range) and so each section of bass, midrange and treble are just smaller ranges within our hearing threshhold.

"Welcome to the Island of people who know too much."..."Did you really think balloons would stop him?!"
See what I'm listening too.
eleet-2k2 is offline   Reply With Quote
Old 18th March 2005, 14:18   #5
misterkik
Junior Member
 
Join Date: Mar 2005
Posts: 3
OK.
In fact i m doing a vis plugin. I want some objects moving in accordance of the bass, the mid and the treble. I don t exactly understand how to treat the data from the spectrum data (given by winamp). When I use these spectrum data, the results are not in accordance of the music.

My question is how to tell winamp to give me some values which could represents the differnts bands of frequencies.
Do I use the spectrum data or anything else ?

Thx.

Mister KIK

PS: thx for your explainations eleet-2k2.
misterkik is offline   Reply With Quote
Old 18th March 2005, 14:26   #6
tracerh
Banned
 
Join Date: Feb 2005
Posts: 84
you can get hold of the avs and geiss code(or two of the vixs plugins anyway) somwhere around here, maybe in the vault
tracerh is offline   Reply With Quote
Old 18th March 2005, 14:32   #7
tracerh
Banned
 
Join Date: Feb 2005
Posts: 84
Look, this is in the bloody SDK
code:
for (x = 0; x < 288; x ++)
{
MoveToEx(memDC,x,(y*256+256)>>(this_mod->nCh-1),NULL);
LineTo(memDC,x,(y*256 + 256 - this_mod->spectrumData[y][x])>>(this_mod->nCh-1));
}

If you don't know about spectrum analysis, fft's and lovely stuff like that already. You'd better be prepared to take a hardcore crash course ... or rip off someone elses code
tracerh is offline   Reply With Quote
Old 18th March 2005, 14:39   #8
tracerh
Banned
 
Join Date: Feb 2005
Posts: 84
gforce and whitecap you can get the src for
tracerh is offline   Reply With Quote
Old 21st March 2005, 08:06   #9
misterkik
Junior Member
 
Join Date: Mar 2005
Posts: 3
Tkx very much I ll take a look at that

Mister KIK
misterkik is offline   Reply With Quote
Old 11th October 2007, 15:54   #10
FabioF68
Junior Member
 
Join Date: Sep 2007
Posts: 7
As for any FFT operation, the scale is linear with frequency, as the sampling is made in constant steps with frequency. The information retained by the spectrum data is complete (reversing the FFT you can reconstruct the original signal).

The issue is only a visualisation one, as we have to span 3 orders of magnitude in frequency (20-20K Hz), hence a log-scale is the one commonly used. A proper algorithm is needed to transform the evenly spaced frequency samples to the log-scale on the screen, accounting for the undersampling at low frequencies and oversampling at high ones.

I'm trying to write one of my own, but if someone is aware of something already working... he's welcome!

bye
Fabio
FabioF68 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump