Fourier transform of dynamic mode coefficients for impinging jet along a line from nozzle exit to plate at a distance 0.6 times jet diameter
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone. I want to calculate the Fourier transform of dynamic mode coefficients for impinging jet along a line from nozzle exit to plate at a distance 0.6d. Then I want to plot the normalized wavenumber(K) spectra (Amplitude vs Kd). I have shared the code here.
Phib=reshape(Phi(:,2),96,1280);
for i=29
for j=945:-1:618
Phibb=Phib(i,945:-1:618);
end
end
Phibb=Phibb-mean(Phibb);
Phibn=Phibb./max(Phibb);
figure(88);
xl=0:4/327:4;
plot(xl,Phibn);
Px=Phibb./max(Phibb);
ff=fft(Px);
ffk=fftshift(ff);
ffn=sqrt((real(ffk).^2)+(imag(ffk).^2));
% Compute the corresponding frequencies
Ln = length(Px);
fre = linspace(-Ln/2, Ln/2, Ln);
kk=2*pi.*fre;
kkn=kk*0.01; %nondimensionalizing wrt jet dia
% xlim=3.5:-3.5/18135:0;
% subplot(r,1,i);
figure(900)
plot(kkn,ffn);
xlabel('kD')
ylabel('|Amplitude|')
I am not getting proper results. Is there any mistake I am doing in the plot? Please check my code.
0 commentaires
Réponses (1)
Paul
le 5 Août 2023
Hi DEBI,
It will be easier for people to help if yor provide all of the information needed to run your code. You should save the variable Phi in a .mat file and then add it to your question using the paperclip icon.
Also, it would be helpful if you show, or at least explain, why the result is not what you expect and what the expected result is.
Also, just from looking at the code, the calculation for fre is incorrect. It should be
fre = linspace(-Ln/2, Ln/2-1, Ln); % if Ln is even
fre = linspace(-(Ln-1)/2,(Ln-1)/2,Ln) % if Ln is odd
But the next line is:
kk=2*pi.*fre;
which kind of suggests that fre is supposed to be in units of Hz, either cycles/sample or cycles/sec. But fre is just a vector of integers, and probably needs to be scaled by 1/Ln or some other factor to get the correct units.
7 commentaires
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!