简体   繁体   中英

complicated matlab image processing

I have a really weird question. Let's assume i have an oscillogram like the one shown below. http://audio.engineeringvista.com/AudioKits/Model-1/Test%20results/Pentode%2010kHz.gif

I need to -somehow- capture the points that compose the signal and afterwards try to make a Fourier analysis and plot the harmonics of the signal. Do you think such an operation could be done in matlab or any other software?

This forum is not a Give Me the Code service!!!...

Having said that, here is precisely what you requested, with the code profusely commented and plotting the image processing steps :).....

%% Processing
% Reading Image
X0=imread('Pentode 10kHz.gif');
X1=512*(X0([21:219],[15:263]));
imshow(512*(1-X1));
X2=X1;
% Removing Division Dotted Lines and Axis
X2(5:5:end,:)=[];
X2(:,5:5:end)=[];
imshow(512*(1-X2));

%% Evaluating
% Obtain Maximums per Points
[~,i0]=max(X2);
% Setting the Proper Scaling
[lx,lt]=size(X2);
xmax=8*2; %2V per division, 8 divisions
tmax=10*20e-6; % 20us per division, 10 divisions
% Applying Time Scaling
t0=(1:lt)'/lt*tmax; % 200us total
% Remove Spurious Points
t0=t0(i0>1);
% Applying Volt Scaling
x0=xmax/2-i0(i0>1)'/lx*xmax;

%% Signal
plot(t0,x0)
xlabel('Time [s]');
ylabel('Volts [V]')

%% Fourier Transform
ln=length(x0);
h=fftshift(fft(x0))/1000; % f in kHz
h0=abs(h);p0=phase(h);
fmax=1/tmax*ln/2/1000; % F in kHz
f1=(0:(ln/2+1))'/ln*fmax;
h1=[h0(ln/2);2*h0(ln/2:end)];
plot(f1,h1)
axis([0 100 0 1])
xlabel('Frequency [kHz]')
ylabel('Spectral Magnitude [x/kHz]')

Check finally the Fourier Transform. Note the proper scales, and the single point around 10kHz, which is the correct value. Note that, because having only two periods of the signal, the FT is not the best method for confirming the frequency and yes, the period in this case is.

在此输入图像描述在此输入图像描述

Greetings.............

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM