17 views (last 30 days)

Hello folks, I am trying to determine the harmful frequencies of my signal. Therefore, I need to do a so called " envelope analysis" for my signal.

I have measured two signal from my sensor. My sensor is located at the tire. Both signals have a shape like sinus. First, I need to rectify the signal. This is done by the following:

XY = sqrt(X.^2+Y.^2);

XY = XY - mean(XY);

Now, I need to determine the envelope curve of my signal. This is done by the following code:

[up1,~] = envelope(XY,30,'analytic');

After that, I need to compute the FFT in order to calculate the harmful frequencies. This is done by the following:

FFTq(up1);

function [f,P] = FFTq(data)

Fs = 1000; % Sampling frequency

T = 1/Fs; % Sampling period

L = length(data); % Length of signal in ms

t = (0:L-1)*T; % Time vector

f = Fs*(0:(L/2))/L; % frequency

FFT = fft(data);

P2 = abs(FFT/L);

P = P2(1:L/2+1);

end

My Matlab program is compiling without any errors. However, the result is not how I expected it. The literature says, that computing the envelope spectra via FFT will provide a better result than computing the FFT. This not the case here. Therefor, I was thinking that my implementation could have some mistakes. Can someone double check my code?

Kind regards

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
## 9 Comments

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1159708

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1159708

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1160973

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1160973

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1162103

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1162103

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1162873

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1162873

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1162968

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1162968

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1163083

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1163083

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1163423

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1163423

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1164353

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1164353

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1164408

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/661618-how-to-rectify-a-signal-and-determine-the-envelope-spectra-for-the-fft-envelope-analysis#comment_1164408

Sign in to comment.