[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
Open Music Labs Forums • View topic - FHT to frequency

FHT to frequency

Moderator: guest

Forum rules
Due to heavy spam, new user registration has been disabled. Hundreds of posts from this sub-forum were accidentally lost in the pruning process.

FHT to frequency

Postby jbolfiil » Tue Jan 20, 2015 5:35 pm

Hello,

I am trying to get the FHT converted to frequency. I saw that the formula was k*(samples/FHT_N) but I can't seem to get what I want...

1. Does k need to be unsigned? I am getting negative values when ever I try to print it out to the serial monitor.

2. How do you find out what the sampling rate is? I have read that you need to look at the prescalar but I am not sure what that is.

I am just trying to write a high on a digital pin when a certain frequency is present. Any help will be appreciated!

Also, will I need to set a magnitude threshold somehow? I only want the high on the digital pin when there is an intentional sound.

(I just realized that I did not bias the signal so that maybe a cause for off numbers.)
jbolfiil
 
Posts: 5
Joined: Mon Jan 19, 2015 5:31 pm

Re: FHT to frequency

Postby guest » Tue Jan 20, 2015 9:14 pm

so to figure out which bin relates to what frequency, you need to know the sample rate. if you are using the default example from the library, that is 38kHz.

Frequency(k) = (k)*(sample_rate)/(FHT_N)

k is just the bin number.

if you want a pin to go high based on a certain frequency, just figure out which bin that is, and then check the value in that bin compared to a threshold, and set the pin high if its above the threshold
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: FHT to frequency

Postby jbolfiil » Wed Jan 21, 2015 11:01 am

jbolfiil
 
Posts: 5
Joined: Mon Jan 19, 2015 5:31 pm

Re: FHT to frequency

Postby guest » Wed Jan 21, 2015 2:01 pm

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: FHT to frequency

Postby jbolfiil » Wed Jan 21, 2015 8:40 pm

jbolfiil
 
Posts: 5
Joined: Mon Jan 19, 2015 5:31 pm

Re: FHT to frequency

Postby guest » Thu Jan 22, 2015 12:04 am

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: FHT to frequency

Postby jbolfiil » Fri Jan 23, 2015 4:06 pm

jbolfiil
 
Posts: 5
Joined: Mon Jan 19, 2015 5:31 pm

Re: FHT to frequency

Postby guest » Fri Jan 23, 2015 4:17 pm

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: FHT to frequency

Postby jbolfiil » Sat Jan 24, 2015 12:37 pm

jbolfiil
 
Posts: 5
Joined: Mon Jan 19, 2015 5:31 pm

Re: FHT to frequency

Postby guest » Sat Jan 24, 2015 9:42 pm

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests


cron