jusroberts / spectrum-analyzer

Ruby wav-file frequency analyzer
https://github.com/jusroberts/spectrum-analyzer
MIT License
17 stars 1 forks source link

domains and time slices? #3

Open rrphotosoft opened 10 years ago

rrphotosoft commented 10 years ago

HI, I tried using your gem and have run into some issues.

1.I'd like to know how exactly the 'range' is to be specified? It does not accept either an array of frequency values or strings . It would help if you could include a simple example to show the behaviour.

2.More importantly, my purpose is to detect the order of the frequencies in the input file, second by second. I could not determine whether each domain represents -- say for example a slice of 10 milliseconds? What does each domain represent? Lets say for example, that the input file is 3 seconds long, and contains three simple tones, of 100 , 200 and 300 Hz, each one second long. How could I go about generating a simple hash like so => {"1" => 100, "2"=>200, "3"=> 300} The keys represent the seconds and the values represent the most dominant frequency at that second. I only raise these issues because, your gem description seems to indicate that this is the primary intention of the gem. All the same, congratulations on building the first sound analysis library for ruby.

jusroberts commented 9 years ago

Hey, sorry about not seeing this for almost a year....

1) { :b_index => 27, :t_index => 47, :min => 1, :max => 2} A range is set by specifying where to look in the spectrum for certain intensities. In this example, look at frequencies 27 to 47 for an average intensity between 1 and 2. (pretty arbitrary, but this wasn't ever designed to be used for anything but very simple analysis: i.e. does the spectrum we're currently looking at have the ranges we are looking for? if yes, return true)

2) I don't think that this will do that by itself. If you're still interested (a year later... sorry again) then I'd say make a PR! Otherwise, you should be able to make such a hash yourself using the resultant spectrums created by your audio file.

jusroberts commented 9 years ago

In fact, I think that a more proper name for that "domain" hash would be a "frequency profile". I'll change that if I ever get around to it.

rrphotosoft commented 9 years ago

Thanks for your clarifications I have forgotten the context in which I asked the questions, I need to find the code where i used the library, if I find it , ill get back to you. 

Sent from Samsung Mobile

-------- Original message -------- From: Justin Roberts notifications@github.com Date:04/02/2015 17:46 (GMT+05:30) To: jusroberts/spectrum-analyzer spectrum-analyzer@noreply.github.com Cc: rrphotosoft rrphotosoft@gmail.com Subject: Re: [spectrum-analyzer] domains and time slices? (#3)

In fact, I think that a more proper name for that "domain" hash would be a "frequency profile". I'll change that if I ever get around to it.

— Reply to this email directly or view it on GitHub.