Converting oscillating motion in a video to a frequency [closed] - audio

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
How do I convert a video of something oscillating to a frequency I can synthesize and tune my guitar to?

You can get a first order approximation to the oscillation by watching the video and using a stopwatch. Hit start on the stopwatch and start counting oscillations. When you reach 10 oscillations, hit stop. Divide the time by 10 and you have seconds/cycle. Take its reciprocal to get cycles/second, or Hz.
But if you could see it oscillating, and not a blur of motion, the frequency was probably < 5 Hz. We don't see very well at more than 20 Hz (hence the > 20 frames/sec for video). Conversely, we don't hear very well below 20 Hz. Maybe you mean you'll tune your guitar to a harmonic of the flax frequency (disclaimer, not a musician).
Also, this question is probably more suited for http://dsp.stackexchange.com.

If the object is not moving with respect to the camera you could grep a pixel (or perhaps an averaged area of pixels) at the border of the object. Generate a time series from that: pixel(time). This time series you could fourier transform and get the peak frequency from that, which should respond to the frequency of the wobbling.

Related

How to handle long audio clips in machine learning? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
What do people do when handling long audio clip(2min-5min, 44.1khz) in machine learning tasks such as music classification?
Is there any methods except downsampling that would help to reduce the dimensionality of audio data?
Usually you are extracting frequency features like spectrogram or MFCC and then you classify them. They have less values than raw audio, so they are easier to analyze.
You can find some visualizations of spectrograms and MFCC here (related to speech, but scales):
https://www.kaggle.com/davids1992/speech-visualization-and-exploration
Note that pooling somehow reduces dimensionality of data in CNN.
So find about spectral analysis. You are rarely working with raw waves, although they are starting to work also, like WaveNet:
https://deepmind.com/blog/wavenet-generative-model-raw-audio/

How to create an mp3 out of a spectrogram in python? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have spectrograms which I acquired without the original sound files. Those are greyscale images, where the x axis represents time and the y axis represents frequency, which each pixel value represents volume (or so I believe).
I am pretty certain the files are those of a few songs and I need to be able to identify which songs those are. There are many files like these, so I need to be able to convert them in bulk.
Is there a way to convert them back to an mp3? How will this be done?
I understand that it won't contain all the original information, but for my purposes any conversion will do.
The answer is: it depends on your needs and resources. It's possible but you may be not satisfied. I understand that you have it in some image files. You should have separate real and imaginary spectrums. Otherwise you lack of all the phase information. But the record should be still 'understable'. Linear scale of frequency domain is desired. Other problem is a resolution.
For audible data you need at least 4k samples/s, so each second of your record should have at least 4000px/Fpx in time domain, where Fpx is amount of pixels in frequency domain.. Assuming the Fpx is 400, each second of your record should have 10px of width. For HiFi it's about 10 times more.
I doubt that the amplitude information - mapped to RGB (or Black-White) is reliable. You will get probably a few bits per sample, where 'the nice' starts at 12bits per sample.

How to build a simple application, that uses audio filter (eg. damping of sound level with distance) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I would like to build a really simple app.
Let say, that apps GUI consists of 2 buttons: "5 meters" and "15 meters".
When the first button is clicked, an audio file would play. When the second button is clicked, the app would apply a filter to the same audio file, so that the user will be able to hear how that same sound sounds like 10 meters away.
Firstly I would like to know, in which programming language an application like this could be written. I have some experience in Java and C++.
Secondly, I would like to know, how to build audio filters (e.g. damping of sound level with distance) and how to integrate it into the app.
I really dont know, where to start.. Any practical example or similar application with available source code would be of much help!
The sound pressure decreases by 1/r. So a doubling of the distance results in a 6 dB lower amplitude. This should be easy to model by a distance dependent amplification.
The interesting part of the problem is the sound absorption caused by air. This absorption is frequency dependent (it is higher for high frequencies) and also depends or air pressure, humidity and temperature. You can find a detailed quantitative model in the ISO 9613-1 standard.
What would be the platform for your app? iOS, android, linux, windows ...? Anyway, I recomend you to have a look at SFML. It's a library in C++ that could help you for multimedia task
about audio in SFML
there is an example for audio levels that change with distance.
Good luck!

What does taking the logarithm of a variable mean? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Question with regards to taking the logarithm of a variable (Statistics Question)
Say you have a bar graph displaying data for an example "Cost of Computer Orders by the Population" and you are trying to analyze the data and find a distribution. The information does not indicate anything so you take the logarithm of the variable and the graph then resembles a normal distribution. I know that the normal distribution basically means the mean, but what does taking the logarithm of the information indicate?
It seems that you are describing the lognormal distribution: a random variable is said to come from a lognormal distribution if its logarithm is distributed normally.
In practice, this can describe processes where the value cannot go below zero, and most of the population is close to the left (right skewness). For example: salaries, home prices, bone fractures, number of girlfriends all could be reasonably modeled with a log normal distribution.
For example: say that on average young adults have had 2.5 girlfriends. A few have never had one; you cannot have "negative number" of girlfriends, and a few bastards have had 25. However, most young adults will have had between, say, one and three.
if you display the values of x as their log(x) then the line in the diagramm is a straight line, when the values grow exponential. This is a stastistically trick for a fast check if values grow exponentionally.

what is the advantage to use Spline to represent curve? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Often hear about curve modeled using spline. What's the advantage of using spline?
Spline data consists of control points and weights that are related to each other (a point on a spline depends on the coordinates and weights several neighboring control points). Curve data would either be a large set of closely spaced points to approximate the curve (expensive to store, where spline data is sparse), or an equation which might take a lot of horsepower to solve for y from a given x. Splines can be cheaply computed and subdivided/interpolated to achieve the desired precision but a curve of explicit points loses precision without having weight information. Splines are also really useful in vector art (think Flash or Adobe Illustrator) and 3D graphics because you can intuitively drag a few control points around to get exactly the curve you want instead of having to move a ton of individual curve points.

Resources