Intensity of sound signal in matlab - matlab

Hi folks I got stuck trying to find the intensity of sound signal. I searched a lot but didn't get any good answers or help. I will be very thankful if anyone could guide me about this.
Thanks in advance

You can just calculate the RMS value of the signal, e.g. if your samples are in X:
intensity_RMS = sqrt(sum(X.*X)/length(X));

Related

Matlab noise in frequency response function (FRF)

I am calculating the natural frequencies and the corresponding FRF of a test sample that is excited with a hammer with an accelerometer attached to the tip as input signal and another accelerometer attached to the test sample to measure the response. The calculation of the natural frequencies works fine, however, when I am plotting the normalized FRF of 40 independent measurements, the noise makes it impossible to discern the natural frequencies as you can see below.
Then I found out about the hanning window and I applied this to my data, which gave me the following FRF:
This is an upgrade, but still way too much noise :-(
I am hoping someone can help me what to do next to remove as much noise as possible! Any help would be appreciated!
I am not sure this is a StackOverflow question, but I will still try to help you:
I would try to use autocorrelation or fft. This question could also help you:Determine frequency from signal data in MATLAB

Sine wave trajectory in MatLab

I was wondering if there was a way to write a function to calculate the trajectory of a sine wave in MATLAB? Any help would be greatly appreciated.
I encountered this same ambiguous question in my MATLAB homework (maybe we're in the same class?). It's very unclear what the question is asking so I had trouble figuring it out too. I ended up trying random sine operations and soon found that the trajectory of the sine wave (T) over time (t) is as follows:
T = sin(t)
As simple as this answer is, I'm not entirely sure why it is correct. I don't usually like giving straight answers but in this case the question is so ambiguous that OP probably wouldn't be able to find the solution without resorting to random guessing like I did.

If there any way to get frequency of sound.

I want to know the frequency of data. I had a little bit idea that it can be done using FFT, but I am not sure how to do it. Once I passed the entire data to FFT, then it is giving me 2 peaks, but how can I get the frequency?
Thanks a lot in advance.
Have a look at this page for an explanation on how to calculate it:
FFT Fundamentals
Please also check this answer (it's C# code but I think you can easily understand it)
How do I obtain the frequencies of each value in an FFT?
And finally have a look at this one, it uses DFT instead of FFT:
Determining the magnitude of a certain frequency on the iPhone
I also found this implementation that you can use in Objective-C:
A lib to find the frequency https://github.com/jkells/sc_listener
A example using the above library https://github.com/jkells/sc_listener_sample
Regards
An FFT will give you the frequency of all the sinusoidal components of a signal. If instead you want just the frequency of the periodicity of common waveforms (more interesting sounding and looking that a plain sinewave) such as produced by speech and music, then you may want to use a pitch detection/estimation algorithm instead of just an FFT peak.

How can i find a sound intensity by using Matlab?

I'm looking for some functions in MATLAB in order to find out some parameters of sound,such az intensity,density,frequency,time and spectral identity.
i know how to use 'audiorecorder' as a function to record the sampled voice,and also 'getaudio', in order to plot it.But i need to realize the parametres of a sampled recorded voice,that i mentioned above.i'd be so thankful if anyone could help me.
This is a very vague question, you may want to narrow it down (at first) and to add as much contextual details as you can, it will certainly attract a lot more answers (also as mentionned by Ion, you could post it at http://dsp.stackexchange.com).
Sound intensity: microphones usually measures pressure, but you can get the intensity from that quite easily (see this question). Your main problem is that microphones are not usually calibrated, this means that you cannot associate an amplitude with a pressure. You can get sound density from sound intensity.
Frequency: you can get the spectrum of your sound by using the Fast Fourier Transform (see the Matlab function fft).
As for spectral or time identity, I believe these are psychoacoustics notions, which is not really my area of expertise.
I'm no expert but I have played with Matlab a little in the past.
One function I remember was wavread() to input a sound signal into Matlab, which if executed in this form [Y, FS, NBITS]=WAVREAD("AUDIO.WAV") would return something like:
AUDIO.WAV:
Fs = 100 kHz
Bits per sample = 10
Size = 100000
(numbers from the top of my head)
Now about the other things you ask, I'm not really sure. You can expect a better answer from somebody else. I think this question should be moved to Signal Processing SE btw.

Getting frequency of sound on iPhone

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
Following is the library used to fid the frequency..
A lib to find the frequency https://github.com/jkells/sc_listener
A example using the above library https://github.com/jkells/sc_listener_sample
Hope it helps some once..
Do you mean frequency or pitch ? If it's just a pure sinusoid and you want the frequency then you can just measure the time between zero crossings (crude) or use an FFT to get the power spectrum and then find the peak (more complex, more reliable).