frequency

Python - Is a dictionary slow to find frequency of each character?

I am trying to find a frequency of each symbol in any given text using an algorithm of O(n) complexity. My algorithm looks like: s = len(text) P = 1.0/s freqs = {} for char in text: try: freqs[char]+=P except: freqs[char]=P but I doubt that this dictionary-method is fast enough, because it depends on the ...

Getting frequency of sound on iPhone

Hi Guys, I'm looking for an Objective-C class that allows me to get the frequency of a live input sound on the iPhone. Didn't find anything useful. Before you ask: the frequency will not change for 0.1 seconds. Thanks for answers, Christian ...

Show frequencies along with barplot in ggplot2

I'm trying to display frequencies within barplot ... well, I want them somewhere in the graph: under the bars, within bars, above bars or in the legend area. And I recall (I may be wrong) that it can be done in ggplot2. This is probably an easy one... at least it seems easy. Here's the code: p <- ggplot(mtcars) p + aes(factor(cyl)) + ge...

Computing frequency of terms in a multidimensional array in Ruby

I have an array : keys=[["a","a","b"],["a","b","c"]] I need to find the number of times "a","b","c" occurs in each sub-array of 'keys'. output could be a hash : ["a"=> [2,1],"b"=>[1,1],"c"=>[0,1]] ...

Problem counting item frequency on T-SQL

I'm trying to count the frequency of numbers from 1 to 100 on different fields of a table. Let's say I have the table "Results" with the following data: LottoId Winner Second Third ...

Python frequency detection

Ok what im trying to do is a kind of audio processing software that can detect a prevalent frequency an if the frequency is played for long enough (few ms) i know i got a positive match. i know i would need to use FFT or something simiral but in this field of math i suck, i did search the internet but didn not find a code that could do o...

Increase frequency calls of touchesMoved

Hi Everyone, Is there a way to increase the frequency calls of touchesMoved than the default? I need more calls of it to draw a smooth circle. It gets called not too frequent by default and so I get an edgy circle. Is there a way to tweek the frequency of touchesMoved calls? Thanks ...

calculating frequency of a number in an Array

I have an array, scores[5][5] and it is filled with test scores. I need to find the most frequently occurring score and return it. ...

"no inclosing instance error " while getting top term frequencies for document from Lucene index

Hello ! I am trying to get the most occurring term frequencies for every particular document in Lucene index. I am trying to set the treshold of top occuring terms that I care about, maybe 20 However, I am getting the "no inclosing instance of type DisplayTermVectors is accessible" when calling Comparator... So to this function I p...

Play a beep that loop and change the frequency/speed

Hi all, I am creating an iphone application that use audio. I want to play a beep sound that loop indefinitely. I found an easy way to do that using the upper layer AVAudioPlayer and the numberOfLoops set to "-1". It works fine. But now I want to play this audio and be able to change the rate / speed. It may works like the sound played b...

Calculating CPU frequency in C with RDTSC always returns 0

Hi, The following piece of code was given to us from our instructor so we could measure some algorithms performance: #include <stdio.h> #include <unistd.h> static unsigned cyc_hi = 0, cyc_lo = 0; static void access_counter(unsigned *hi, unsigned *lo) { asm("rdtsc; movl %%edx,%0; movl %%eax,%1" : "=r" (*hi), "=r" (*lo) : /...

Get highest frequency terms from Lucene index

Hello! i need to extract terms with highest frequencies from several lucene indexes, to use them for some semantic analysis. So, I want to get maybe top 30 most occuring terms(still did not decide on threshold, i will analyze results) and their per-index counts. I am aware that I might lose some precision because of potentionally dr...

how to make a frequency function in matlab like the excel frequency function?

I have a list that is sorted and I want to know how many values are in each bin? I made bins using linspace(floor(fist_element_list), ceil(last_element_list), num_bins) Is there a built in function or an easy way to do this in Matlab? All I can think of is doing it manually. I would like a frequency function like the one in excel. ...

term frequency calculation

hi..i m in a doubt... i need to calculate term frequency of term in a document... what i did is simply just " counted the no of times that term appears in that document"...if that term appeared say 138 times i took the tf value as 138....m i doing right..?? as i read somewhere that termfrequency (tf)= term count/ no of words in the docu...

Spatial domain to frequency domain

I know about Fourier Transforms, but I don't know how to apply it here, and I think that is over the top. I gave my ideas of the responses, but I really don't know what I'm looking for... Supposed that you form a low-pass spatial filter h(x,y) that averages all the eight immediate neighbors of a pixel (x,y) but excludes itself. a. Fin...

How big is interval between taking pictures in Android phone?

I'm wondering how fast I can take pictures one after another withoud surprises from the phone (like fx: 'force close;) Does any of you know that time? I know that 500 milisec is safe time. When i experiment with 100, 200, 300 milisec there is error but who knows, maybe i do sth wrong. ...

How to Find Frequency while recording voice in iphone?

Hi Friends, In my application i have done to record the voice and playing in the device. Now i want to find the audio frequency of that recorded voice(While recording). How can i find?.I dont have any idea. I have downloaded "aurio Touch" program.But its too difficult to understand me. So is there any tutorials are avilable(in iPhone)?....

Dynamically calculate frequency value?

Hi, In my app, I want to find/calculate the audio frequency as dynamically when i am recording an audio and no need to save, play and all. Now i am trying to do that with help of an aurioToch sample code. In that sample, inside FFTBufferManager class methods such as GrabAudioData and ComputeFFT,Here I am not able to find where they are ...

Determine the frequency of occurrence in XQuery

Hi, does anybody know a way of determining the number of times in which a particular value occurs in a sequence, with XQuery. Thanks in advance ...

Get the most repeated element in a sequence with XQuery

Hello, I've got a sequence of values. They can all be equal... or not. So with XQuery I want to get the most frequent item in the sequence. let $counter := 0, $index1 := 0 for $value in $sequence if (count(index-of($value, $sequence))) then { $counter := count(index-of($value, $sequence)) $index1 := index-of($value) } else {} ...