Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all;
- clear all;
- clc;
- ct = 1;
- for i = 0.030:.00400000000000000000:0.150
- format = '%#0.3f\n';
- str = num2str(i, format);
- modstr = str(2:end);
- ez = h5read(sprintf('hsli%s.h5',modstr),'/ez');
- N = length(ez);
- res = 5; % Samples per unit length
- dx = 1/res; % Length increment per sample
- x = (0:N-1) * dx; % Position vector
- NFFT = 2^nextpow2(N); % Next power of 2 from length of y
- Y = fft(ez,NFFT) / (N * max(ez));
- kfft = res / 2 * linspace(0, 1, NFFT / 2 + 1);
- ABSY = 2 * abs(Y(1:NFFT / 2 + 1));
- % plot(kfft, ABSY);
- title('Amplitute Spectrum', 'fontweight', 'bold');
- xlabel('Wavevector(k)', 'fontweight', 'bold');
- ylabel('|Y(f)|', 'fontweight', 'bold');
- ind(ct,1) = find(ABSY == max(ABSY));
- k(ct,1) = kfft(ind(ct,1));
- w(ct,1) = i;
- ct = ct + 1;
- end
- plot(w, k * 2 * pi, '-r', 'linewidth', 3);
- title('Dispersion Graph', 'fontweight', 'bold');
- xlabel('Wavevector(k)', 'fontweight', 'bold');
- ylabel('Angular Frequency(w)', 'fontweight', 'bold');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement