Matlab - Find Frequency - Amplitude of signal - matlab

I have this signal:
It represents the rotational movement of a system. I need to define this movement, more specifically I need to find the (main) frequency of it and the amplitude of it. I believe that the long term movement could be a drift. I mostly care about the high-frequency movement.
FFT is giving this:
Any idea?
Thanks!

Related

Impossibility to apply closed-loop filtering techniques modelling a thin flexible structure

Model approach:
I am modelling on Matlab-Simulink a very thin flexible structure. All points of the model are link with each other with springs and dampers this way (without the tethers in the center):
Mesh description
The general equation of my model applied at each point of the mesh is the following:
Dynamic formula of mass/spring/damper system
With k the springs stiffness, and c the dampers damping.
To adapt the physical properties of the material I want to model, the spring stiffness has been set to a very high value, around k = 5000. This mean that my spring links are highly reactive to any deformation.
Problem:
This leads to my problem: High stiffness links induce high frequency displacement that I can consider as noise in the simulation.
The simulation is much slower as the variable time step, I am using must be very low.
This high-frequency displacements (around 160 Hz, which the resonance frequency of the springs) stays all along the simulations.
Here is a simulation of my structure rotating at a constant angular speed:
In-time evolution of a random point of my structure in spherical coordinates
We can see that R is vibrating at a very high frequency. However, the displacement amplitude is clearly negligible.
To speed up the simulation, I want to suppress those vibrations!
Investigation:
To suppress them, I investigate on signal filtering techniques, mainly low-pass filtering. On every loop of our simulation, and what should enter our filter are data of all my points in all my axis.
Simulink low-pass filter block
The continuous version of low-pass filter in Simulink library has been tested on the acceleration, the speed and the position, with several cut-off frequencies from 100 Hz to 500 Hz.
For example, for a cut-off frequency of 200Hz and filtering the position at t=0.6 sec I have:
In-time filtered evolution of a random point of my structure in spherical coordinates
It is an in-plane movement so I don’t have any elevation angle, but azimuth angle and point distance from the center are completely diverging.
The problem might come from:
The fact that I am in a closed-loop system
The fact that for the mesh we have, the filter receives 81 vectors of 3*1 at each time step and maybe the filter block is not made to function with that.
The fact that for the mesh we have, the filter receives 81 vectors of 3*1 at each time step and maybe the filter block is not made to function with that.
Main question:
Are there filtering techniques for closed-loop and multiple inputs system that could solve my problem?
Digital filter designer works with SISO signals. Just demux your signals and apply some lowpass filters. You gave lots of info that made it harder to understand the core problem, if there is anything else you can re-iterate. I'd start with a 3rd order Butterworth LPF wc at around 100Hz for your needs.

Calculate SNR of drifting signal in MATLAB

I have a signal that is both noisy and drifts. I want to calculate the noise of the signal, but I think for this drift should not be taken into account as "noise". using the snr() funciontion in matlab will give me a really high noise value, I think because it takes into account the drift, right?
How can I calculate it? is there any function available for this?
In this picture, for instance, the noise should be around 2% right? ((22.45-22.36)/2)/22.38. (although what I really want is the SNR value)
Thank you!
Filtered signal with low pass filter with a really low frequency:
I would approach this by identifying the drift of the signal with a low pass filter. Just subtract the filtered signal from the original signal. This will lead to noise signal with low drift.
Filtering the signal might be the most difficult task, but by playing around with the filter parameters this will work

Signal processing using MATLAB

I'm trying to do some signal processing using an audio file (piano recordings)
I find the note onsets and then perform FFT on each onset. However I find that for certain notes their 2nd harmonic has a way greater amplitude than he fundamental... Why is that???
How can I eliminate this and get the correct frequency??
Start by using a low-pass filter to trim out some of the higher-order harmonics. If the piano recordings that you are trying to process were recorded within a 3 octave range, that should help substantially.
Next, try adjusting your wave amplitude. Here's an article that discusses how harmonic distortion degrades a signal, and how you can exchange signal-to-noise ratio for harmonic distortion.
http://www.mathworks.com/help/signal/examples/analyzing-harmonic-distortion.html
If you want more of a home-built solution without signal filtering, here's what I'd try, assuming that the maximum signal amplitude corresponds either to the fundamental, 2nd harmonic, or 3rd harmonic
1) Find the frequency f of the maximum signal
2) If the signal at f/2 or f/3 is much greater than the noise floor, call that frequency your fundamental
Alternatively,
1) Find the frequency f of the maximum signal
2) Search above in the interval [f/2, 2*f] and find the peak nearest f.
3) Assume the difference between f and the nearest peak is 1 the fundamental frequency.
You'll need to adapt these methods to your data.
Make sure your data doesn't exhibit only odd order harmonics or has very strong high-order harmonics. These methods won't work well if multiple notes are played simultaneously.
You could also try correcting your data for human ear sensitivity, as that may be the reason why the 2nd harmonics are louder on an FFT than what the ear detects relative to the fundamental. See http://en.wikipedia.org/wiki/Absolute_threshold_of_hearing

Accelerometer Noise

I read in the internet that Accelerometer suffers from 1/f noise at low frequencies and Gaussian noise at high frequencies. But i didn't understand what frequency they are referring to? Is it the sampling frequency of the accelerometer? or operating frequency of the mobile phone processors(I was looking for MEMS Accelerometer in android phones)?or frequency of some other signal(if yes then what kind of signal)?
They're talking about the frequency of the input signal. Since this is an accelerometer the input signal is movement.
Fast, high frequency vibrations suffer from Gaussian noise. Slow, low frequency motion suffer from drift. This limits the range of motion you can accurately measure with accelerometers.
Additional answer:
What does frequency refer to when it comes to motion? It simply refers to the change in direction of motion, or more specifically the change in direction of the vector of motion.
It may be difficult to imagine that linear forward motion has a frequency but linear forward motion only has a frequency of zero if the object either travels at constant speed or constantly accelerates for eternity. For a car or a train or a plane or a boat or a spaceship this is not the case. All vehicles in motion has to stop eventually. When it stops, it has completed a motion with frequency of 1/(2*time_of_journey).
For accelerometers, the frequency is more since accelerometers measure acceleration, not distance. So if the vehicle travels like a spaceship which accelerates only once and decelerates only once then the frequency of the input will be 1/time_of_journey (since the value of acceleration starts at and returns to 0). But for cars and boats and bicycles and most other vehicles the frequency is significantly higher since most vehicles constantly accelerates and decelerates. So the frequency of acceleration is generally 1/(time_of_journey/number_of_times_you_hit_the_brakes).
Seriously, the numbers for this is generally very low. Take the simple example of a spaceship going to the moon and ignore the launch and landing. The frequency of acceleration for Neil Armstrong's trip to the moon was 1/4 days or 0.000003 Hz. That doesn't look like much of a frequency.
So why state the parameter in terms of frequency? Well, in signal processing motion is generally assumed to be sine waves. It's not realistic and doesn't reflect the real world but is good enough and simplify things enough to the point where we can write down equations to model things. Which is why you see things like "accelerometer noise" being quoted in terms of frequency.
Vehicles also do experience acceleration at higher frequencies though. Vibrations caused by the engine and bumps in the road and friction with the air has frequencies in ranges that we recognize as being periodic. Indeed, often our ears detect such things as rattling or humming or swooshing sounds. Sensitive accelerometers detect them too.

Removing noise from wave audio file in MATLAB

I have two wave files, one is normal version, another one is distorted version. In distorted version, I hear a long beep like sound. Here are the frequency domain plots of normal and distorted version sounds. First one is normal, second one is distorted. notice the scales.
How do I go about this?
It's a bit hard to tell without using a marker or zooming in, but it seems you have a sinusoid inserted to your signal, which would explain the continuous beep you hear and the delta like function you have in the spectrum. Try to locate the noise frequency using the marker and filtering it using the filter design tool (type "fdatool" in the command line). I would go for a notch filter at the frequency of the noise, and if this doesn't work a high (~1000) order high pass FIR filter.
Good luck
Since you have the signal in frequency domain, you can also remove the noise there (with a simple threshold) and then you take inverse Fourier transform and you get the noise free signal in time domain.