how to convert pressure versus time to pressure versus frequency using fft function
Afficher commentaires plus anciens
I have tried to convert pressure versus time data to pressure versus frequency using FFT function
This is the pressure versus time signal

after using fft
deltaT=2.5e-6;
fs=1/deltaT;
pxx0 = fft(p);
n = length(p); % number of samples
f = (0:n-1)*(fs/n); % frequency range
mag=abs(pxx0);
figure(1)
semilogx(f,mag)
ylabel ('magnitude');
xlabel ('frequency');
This is the output of FFT function

How to convert the magnitude of FFT to corresponding pressure value like this graph ? in form of pressure versus frequency

2 commentaires
BALAJI KARTHEEK
le 23 Avr 2020
u should scale the pressure and frequency axis to get what u wanted for i need the pressure data or i can given an of how to convert the pressure and frequency axis. Good luck. if you want any help you can free to contact me
%T18EE009 D J K S S BALAJI
%DETERMINE THE MAGNITUDE OF FUNDAMENTAL SIGNAL OF SINUSODIAL AFTER USING FOURIER TRANSFORM
%INPUT DATA
clc
clear all
f=50;%frequency
FM=50;%FREQUENCY TO OBTAINED
T=0.2;%TIME OF THE SIGNAL
N=1024;%NO OF SAMPLES
S=0.02/N;%SAMPLE TIME
fs=1/S;%SAMPLING FREQUENCY
t=0:S:T-S;%timeinterval
O=30*(pi/180);%phase angle
X=200;%MAGNITUDE
for j=1:N*(T/0.02)
x1(1,j)=0;
end
for k=1:20
A=(X/k)*sin((2*3.141*k*t*f)+(O));%CREATION OF HARMONICS
x1=A+x1;
end
t1=1;
t2=0;
for i1=1:(T/0.02)
for i=t1:t1+N-1
A(1,i-t2)=x1(1,i);
end
y=fft(A);%APPLYING FFT
c=abs(y);%CONVERTING COMPLEX VALUES TO ABSOLUTE VALUES
Q=2*c/N;%CONVERSION OF SAMPLING DOMAIN TO MAGNITUDE DOMAIN
B1=(FM*N/fs)+1;%OBTAINING THE FUNDAMENTAL FREUENCY FROM BINS
op(i1)=Q(1,B1);%OBTAINING FUNDAMENTAL MAGNITUDE FROM FFT
ph(i1)=angle(y(1,B1))*(180/pi)+90;
t1=t1+N;
t2=t2+N;
end
t5=0.02:0.02:0.2;
yyaxis left
plot(t5,op)
yyaxis right
plot(t5,ph,'--')
zein
le 23 Avr 2020
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Fourier Analysis and Filtering dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




