I am trying to get an envelope for a spectrum I measured.
I have used the hilbert function in MATLAB which works for a dummy function I wrote,
but it does not give the correct result for my spectrum. (I got back the exact same curve).
I am thinking the oscillation of my spectrum is too fast but not too sure on this.
Hope someone can tell me what is wrong here.
A=xlsread('test.xls');
y=A(:,2);
h1=imag(hilbert(y));
E=sqrt(y.^2+h1.^2);
Related
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
I noticed that there are only not-a-knot and clamped spline in Matlab, which is assembled in the function spline. Can we change the original code in matlab a little bit so it can perform (or only perform) natural spline? I felt like it is a easy task since we need only to change the extra two degrees of freedom of parameters, such that it is satisfied to have zero second derivatives at the end points. But staring at the code of spline I don't know how to proceed. Can anyone help me out?
I don't know how to compute the envelope of a signal. I've already seen the mathwork solutions firstSolution secondSolution but they does not work in the signal I'm working with.
This signal provides from a pressure sensor and it's sampled at a frequency of 1kHz and it has 100000 samples.
I've read that with the hilbert transform I could get the envelope by doing abs(hilbert(data)) being data the values of the signal2.txt but it has not work. I've also tried with taking the absolute value of the analytic signal but it has not work either.
The solution I've tried is to find the peaks and put them together linearly but it does not work properly because I want a continuous and derivable function as result so as I need to derivate it.
I hope you knew the solution to my problem. :)
I know it may be a basic question but I am having trouble with the limits when applying the fft function in Matlab.
I have a time series from this specifications:
bdf=0.005;
fHighCut=0.2;
maxTime=600;
freq=1/maxTime:df:fHighCut;
w=2*pi*freq;
time=linspace(0,600,length(freq)*10);
My time series lloks like:
The length of it is 400s. I want to create the PSD from it but it appears that I am obtaining the symetric as well like:
with this commands:
timestepFFT=1/time(end);
freqFFT=(1:length(time))*1/time(end);
amplitudeEtaSeries=abs(fft(etaSeries)/length(time));
powerSpectrumEtaSeries=amplitudeEtaSeries.^2/timestepFFT;
powerSpectrumEtaSeries(1)=0;
Can you please help me? THanks
Please read this article. power spectral density calculation by using fft always produce the symmetric PSD. So ignore second half of fft output and details can be found here:
http://www.mathworks.se/help/signal/ug/psd-estimate-using-fft.html
I've tried to do a fast fourier transform in Matlab of some data taken from an experiment in the windtunnel trying to show the frequency of the velocity variation in a flow, but somehow I keep on getting 0Hz as the main frequency. Anyone has encountered this problem before and knows how to solve it or can explain me a bit better how to do the frequency transform.
Ps: It seems to be doing the fast fourier transform alright, the problem might be when converting the data from imaginary to real values
Help me please!
Thank you!
This is a pretty normal thing to encounter. The 0 Hz component (often referred to as the DC component in analogy to the electrical equivalent) is the constant, non-time-varying component of the data -- it's equivalent to the mean of the data. If you have data that does not have a mean of zero, this is a very normal thing to see.
If you want to, you can calculate the mean and then subtract it from your data series, but this is not really necessary, since it will only change that DC component of the FFT. If you're not interested in the DC component for your purposes, you can simply ignore it.