取得した電流を、256×256ピクセルの画像にする方法を教えてください。
Show older comments
以下のプログラムで取得した、トンネル電流zを用いて256×256ピクセルの画像を作りたいです。
また、ローパスフィルターを適用した後のトンネル電流(lowpass_signal)を用いて、256×256ピクセルの画像を作り、ローパスフィルター適用前後の画像の比較を行いたいです。
トンネル電流zとローパスフィルターを適用した後のトンネル電流(lowpass_signal)は、どちらも1×30117647doubleのデータ数となっています。
pixel_image = 256; %ラスタ走査によって得られる画像のピクセル数を入力(2^nを入力)
dr = 1/(2*sqrt(3)); %ディザ円半径を入力[格子]
a_fast_grid = 10; %fast軸走査範囲[格子]
a_slow_grid = 10; %slow軸走査範囲[格子]
fm=5000; %ディザ円変調周波数[Hz]
fs= fm*240 ; %サンプリング周波数[Hz]
f_fast = 10.2; %走査周波数[Hz]を入力(1[s]の1line走査回数)
start_point_x = 0; %走査開始点のx座標を入力(1[格子]分動かしたい時は1を入力)
start_point_y = 0; %走査開始点のy座標を入力(1[格子]分動かしたい時は1を入力)
%fast軸三角波のパラメータ設定
amplitude_fast = a_fast_grid/2; %fast軸振幅
%slow軸三角波のパラメータ設定
amplitude_slow = a_slow_grid/2; %slow軸振幅
f_slow = (f_fast)/(2*pixel_image); %slow軸三角波周波数
% 時間ベクトルの生成
total_time=256/f_fast; %全走査時間
t = linspace(0, total_time, fs * total_time);
x_raster = start_point_x + amplitude_fast*(2/pi)*acos(cos(2*pi*f_fast*t));
y_raster = start_point_y + amplitude_slow*(2/pi)*acos(cos(2*pi*f_slow*t));
x_dither = dr*cos(2*pi*fm*t);
y_dither = dr*sin(2*pi*fm*t);
x = x_raster + x_dither;
y = y_raster + y_dither;
z1 = cos(2*pi*((x-y)/(sqrt(3))));
z2 = cos(2*pi*(2*y/(sqrt(3))));
z3 = cos(2*pi*((x+y)/(sqrt(3))));
z = (z1 + z2 + z3);
%参照信号作成
w = 2*pi*fm ;
phi = 0 ;
reference_signal = sin(w*t+phi) ;
%ミキシング信号作成
mixising_signal = z.* reference_signal ;
%ローパスフィルターの適用
f_cutoff = 500 ; %カットオフ周波数[Hz]の設定
lowpass_signal = lowpass(mixising_signal,f_cutoff,fs) ;
Answers (0)
Categories
Find more on Video Formats and Interfaces in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!