ソースを参照

rename some parameters

Fernando Pablo Lopez-Lezcano 9 年 前
親
コミット
45f8d24f62
1 ファイル変更、8 行追加、8 行削除
  1. 8 8
      calibration/src/sphear_capsule_plot_frequency_response.m

+ 8 - 8
calibration/src/sphear_capsule_plot_frequency_response.m

@@ -5,13 +5,13 @@
 %% sphear_capsule_plot_frequency_response: plot frequency response of capsule signals
 %%
 %% usage:
-%%   [] = sphear_capsule_plot_frequency_response(SIG, fmin, fmax, ymin, ymax, Nfft, plot_on, smooth)
+%%   [] = sphear_capsule_plot_frequency_response(SIG, fmin, fmax, ymin, ymax, FS, fft_size, plot_on, smooth)
 %%
 %% SIG: signals for each measurement
 %% fmin, fmax: range of frequencies to use
 %% ymin, ymax: y range to plot
-%% Fs: sampling rate
-%% Nfft: size of fft used to calculate frequency response
+%% FS: sampling rate
+%% fft_size: size of fft used to calculate frequency response
 %%
 %% optional parameters:
 %%
@@ -35,9 +35,9 @@
 %%  You should have received a copy of the GNU General Public License
 %%  along with this program.  If not, see <htp://www.gnu.org/licenses/>.
 
-function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fmax, ymin, ymax, Fs, Nfft, smooth)
+function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fmax, ymin, ymax, FS, fft_size, smooth)
 
-  %% no smoothing or plotting by default
+  %% no smoothing by default
   if (!exist("smooth"))
     smooth = 0;
   end
@@ -45,9 +45,9 @@ function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fm
     %% calculate frequency responses
     for m = measurements
       if (smooth > 0)
-	sfft(m,c,:) = fastsmooth(20*log10(abs(fft(SIG(m,c,:), Nfft))), smooth, 2, 1);
+	sfft(m,c,:) = fastsmooth(20*log10(abs(fft(SIG(m,c,:), fft_size))), smooth, 2, 1);
       else
-	sfft(m,c,:) = 20*log10(abs(fft(SIG(m,c,:), Nfft)));
+	sfft(m,c,:) = 20*log10(abs(fft(SIG(m,c,:), fft_size)));
       end
     end
     %% color plot
@@ -56,7 +56,7 @@ function [] = sphear_capsule_plot_frequency_response(SIG, measurements, fmin, fm
 
     f = figure;
     hold on;
-    fr = (1:Nfft/2) * Fs/Nfft;
+    fr = (1:fft_size/2) * FS/fft_size;
     grid on;
     angle = 360 / 16 * (m - 1);
     %% we add the title as a subfigure in the paper