Old 24th April 2004, 00:45   #1
jppoulin
Junior Member
 
Join Date: Apr 2004
Posts: 2
Frequency

I am very new to AVS. Please excuse my questions if they seem simple, pointless or stupid. That aside I am curious if one is able to detect the specific frequencies in the song? My plan is to do beat detection. However from what I have read in the forums they are not tailored to what I would like. I want the avs to bump to the frequencies a subwhoofer would move to. This would be 25-100 hz for me. Can somebody help or give me a place to find what I am looking for? Thank you in advance.

Jon
jppoulin is offline   Reply With Quote
Old 24th April 2004, 00:58   #2
mikm
Major Dude
 
mikm's Avatar
 
Join Date: May 2001
Location: somewhere else
Posts: 1,286
getspec(band,width,channel) and getosc(band,width,channel)
band and width are 0 to 1, channel is 0- center, 1- left, 2- right

powered by C₈H₁₀N₄O₂
mikm is offline   Reply With Quote
Old 24th April 2004, 01:35   #3
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
Join Date: Jun 2001
Posts: 2,104
m²k: that won't help one bit, if you don't know the spectrum and frame size.

To figure out framesize, use a superscope like this:
x=i*2-1;y=getspec(i/576*3,0,0)

The framesize is 576, so a width (relative to 0..1) of 3/576 gives you 3 samples in the spectrum plot.
As far as I know, framesize is independent on sampling rate.

The highest frequency in the spectrum plot is the nyquist frequency, which is half your sampling rate. Most commonly the sampling rate is 44kHz, so the nyquist frequency is 22kHz.

The lowest sample in the frequency component is the DC/0 Hz component. The second sample is 22 kHz / 576 = 38.2 Hz.

The frequency scales up linearly, where frequency = (zero-based index) * 22 kHz / 576:

So getspec(x,0,0), where x is:
0/576 -> 0 Hz/DC
1/576 -> 38.19 Hz
2/576 -> 76.39 Hz
3/576 -> 114.6 Hz
...
574/576 -> 21.92 kHz
575/576 -> 21.96 kHz
576/576 -> 22 kHz

The frequency samples are discrete (as the superscope to discover framesize showed). To figure out in betweens, you would need to convolve the spectrum as dirac impulses, with sin(x*τ )/(x*τ ) where 2π/τ = frequency spacing.

However, you might get away with just linear interpolation though.

For MP3s with other sampling rates, the frequencies are different. As far as I know you can't access the sampling rate from AVS, but 99% of all MP3s are sampled at 44kHz anyway. Maybe you'll find some at 48kHz, but then the frequency shift is minimal.

UnConeD is offline   Reply With Quote
Old 24th April 2004, 02:04   #4
hungryskull
Major Dude
 
hungryskull's Avatar
 
Join Date: Feb 2003
Location: Somewhere in Canada
Posts: 776
Unconed:It's likely the n00b will get much more out of that than he would out of m²k's post. It's ummmm..., rather technical.

Darn, I can't think of anything to put here.
hungryskull is offline   Reply With Quote
Old 24th April 2004, 02:17   #5
S-uper_T-oast
Forum King
 
S-uper_T-oast's Avatar
 
Join Date: May 2003
Location: Fnord?!
Posts: 2,657
Nice post UnConeD


You know way to many things for your own good...
S-uper_T-oast is offline   Reply With Quote
Old 24th April 2004, 03:30   #6
jppoulin
Junior Member
 
Join Date: Apr 2004
Posts: 2
That helps a lot. I will have to learn some of the things you talk about but I get the jist of it. Just out of curiousity. Everything I listen to is wav files. So would the sampling be 48.1khz and the nyquist be 24.05kz? And if you guys could give me a link to a good site to learn more that would be great. Maybe like a tutorial? Thanks so much.
jppoulin is offline   Reply With Quote
Old 24th April 2004, 04:09   #7
DynamicMovement
Banned
 
DynamicMovement's Avatar
 
Join Date: Apr 2004
Location: Winamp AVS Editor
Posts: 10
Send a message via ICQ to DynamicMovement Send a message via AIM to DynamicMovement Send a message via Yahoo to DynamicMovement
I have a question: If my getspec was around 100/222 then what's frequency I will get?

I experienced this question many times, But, I did not get my favorite answer.
If UnConeD knows please tell me.
DynamicMovement is offline   Reply With Quote
Old 24th April 2004, 04:37   #8
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
WAV files? o_O big files
on what do you need a tutorial?

To use what unconed just explained:
value=getspec(Hz/nyquist,0,channel);
or
value=getspec(Hz/sampling*2,0,channel);

where channel is 0 for center, 1 for left and 2 for right channel

If you can't say something nice, say something surrealistic.
TomyLobo is offline   Reply With Quote
Old 24th April 2004, 07:17   #9
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
Join Date: Jun 2001
Posts: 2,104
DynamicMovement: use your brain for 5 seconds and you should be able to figure it out with what I said.

UnConeD is offline   Reply With Quote
Old 24th April 2004, 09:52   #10
Deamon
Major Dude
 
Deamon's Avatar
 
Join Date: Nov 2002
Location: Arnhem, the Netherlands
Posts: 927
For some good Tutorials search the forums for Atero's Primer and PiR's AVS tutorial. There's some good stuff on visbot as well. I'm still working on my own tutorials which will eventually come on www.iabvisuals.tk .

.:HyperNation @ winamp:. .:DeviantArt:.
Thermal is now available for download at DeviantArt.
Deamon is offline   Reply With Quote
Old 8th June 2004, 19:41   #11
blaz
Member
 
blaz's Avatar
 
Join Date: Apr 2004
Location: Slovenia [EU]
Posts: 69
Quote:
Originally posted by DynamicMovement
I have a question: If my getspec was around 100/222 then what's frequency I will get?
I thing it will be 9909,909... Hz.

100/220*22khz=9909,909... Hz
or
100*22Khz/220=9909,909... Hz


I hope I am right
blaz is offline   Reply With Quote
Old 8th June 2004, 20:54   #12
Warrior of the Light
Forum King
 
Warrior of the Light's Avatar
 
Join Date: Aug 2002
Location: The Netherlands
Posts: 4,121
Please don't revive dead threads with useless information.
It is most likely the guy doesn't even read these threads anymore since these are his only two posts over the entire WA forum.

Jesus loves you [yes, you] so much, he even died for you so that you will not need to die, but live forever
Warrior of the Light is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS

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