sampling

Sound sampling at low frequencies

I've actually posted this question before, but it hasn't been answered. Maybe I wasn't clear enough, so let me rephrase: As you know, when you're sampling a signal at a certain sampling rate, any frequency that's higher than half of the sampling rate gets aliased. In order to avoid it, you need to pass the signal (either in the analog f...

Question about timing in C# real time audio analysis

I'm trying to determine the "beats per minute" from real-time audio in C#. It is not music that I'm detecting in though, just a constant tapping sound. My problem is determining the time between those taps so I can determine "taps per minute" I have tried using the WaveIn.cs class out there, but I don't really understand how its sampl...

C# DirectSound - Capture buffers not continuous

Hi, I'm trying to capture raw data from my line-in using DirectSound. My problem is that, from a buffer to another the data are just inconsistent, if for example I capture a sine I see a jump from my last buffer and the new one. To detected this I use a graph widget to draw the first 500 elements of the last buffer and the 500 elements...

Selecting nodes with probability proportional to trust

Does anyone know of an algorithm or data structure relating to selecting items, with a probability of them being selected proportional to some attached value? In other words: http://en.wikipedia.org/wiki/Sampling_%28statistics%29#Probability_proportional_to_size_sampling The context here is a decentralized reputation system and the atta...

getting a good sample of pixels from an image

lets say I have a big image with about 90% greenish pixels, 9% bluish pixels and 1% brownish pixels. I want to get a sample of only 100 pixels from the whole image having around maybe 2000,000 pixels. I don't want the sample to contain pixels relative to their frequency in the original image, rather it should have equal number of greeni...

Sampling keys due to their values

Hi guys, I have a dictionary(python) with key->value (str->int). I have to chose some key due to it's own value. Then bigger this value the key has less posibility to be chosen. For example if key1 has value 2 and key2->1 key1 the attitude should be 2:1. How can I do this? ...

Change the playback rate of a track in real time on Android

Hello, I would like to know if somebody knows a library to changing the playback rate of a track in real time. My idea is to load a track and change its playback rate to half or double. Firstly, I tried with MusicPlayer but is was not possible at all and then I tried with SoundPool. The problem is that with SoundPool I can´t change the ...

Estimating the boundary of arbitrarily distributed data

I have two dimensional discrete spatial data. I would like to make an approximation of the spatial boundaries of this data so that I can produce a plot with another dataset on top of it. Ideally, this would be an ordered set of (x,y) points that matplotlib can plot with the plt.Polygon() patch. My initial attempt is very inelegant: ...

Algorithms for determining the key of an audio sample

Hi, I am interested in determining the musical key of an audio sample. How would (or could) an algorithm go about trying to approximate the key of a musical audio sample? Antares Autotune and Melodyne are two pieces of software that do this sort of thing. Can anyone give a bit of a layman's explanation about how this would work? To ma...

Windows Vista Speech Recognition engine sampling rates

I need to recognize the speech from a set of WAV files that are not recorded on the computer doing the recognition. I know that if you recognize the speech from WAV files that are recorded at the same sampling rate as the recordings that the engine used for training, the results will be better. But my questions is: what's the sampling r...

Programming Musical Instrument Emulators?

I'm interested in, and trying to find information on, the topic of programming musical instrument emulators. As an example, see http://www.youtube.com/watch?v=RhCJq7EAJJA (Smule's Ocarina app for the iPhone). However, I'm not finding much information on this topic. Running with the ocarina app as an example, how are the individual notes...

PHP randomly select from a list

I am currently working with PHP code that random selects colors: <div onclick="location.href='<?php the_permalink() ?>';" style="cursor:pointer;background:#<?php echo rand(0, 9); ?><?php echo rand(0, 9); ?><?php echo rand(0, 9); ?><?php echo rand(0, 9); ?><?php echo rand(0, 9); ?><?php ...

Select cells randomly from NumPy array - without replacement

I'm writing some modelling routines in NumPy that need to select cells randomly from a NumPy array and do some processing on them. All cells must be selected without replacement (as in, once a cell has been selected it can't be selected again, but all cells must be selected by the end). I'm transitioning from IDL where I can find a nice...

symbian C++ downsizing libraries

I wish to record audio at 32 kHz on my Symbian device but it only supports 48 kHz. From searching the internet I believe the term for what I am trying to do is called downsizing. Is there a C++ library that will compile and run on Nokia Symbian phones that will do this for me? Or is the algorithm simple enough for me to implement on my o...

What is the leanest format for AVAudioRecorder?

I would like to record voice using AVAudioRecorder, and it really doesn't have to be high quality at all as long as it is coherent. What is the leanest settings I should use to attain the smallest file sizes? Right now, I use the following, but am not even sure if some of them are relevant to my using .aif files (IMA4). NSDict...

How to equidistant resample a line (or curve)?

I have a line l_1 given with a point series p_1,...,p_n. I now want a new line l_2 having k points: q_1,...,q_k. But for all i \in {1,...,k-1}: abs( q_i - q_i+1 ) = const, meaning the segments of l_2 are equidistant or uniform. k >= 2 and p_1 and p_n should be in l_2. abs( p_i - p_i+1 ) not const One solution is to approximate a line...