electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

CRO + MATLAB = Spectrum analyzer ?


Post new topic  Reply to topic    EDAboard.com Forum Index -> Software Problems, Hints and Reviews -> CRO + MATLAB = Spectrum analyzer ?
Author Message
engineer



Joined: 09 Apr 2005
Posts: 62
Helped: 1


Post02 Jul 2008 15:32   

analog cro working


hi
i took the picture attached from CRO and I want to analyze it using MATLAB to know the harmonic components in it
I don't have a spectrum analyzer so i want to use MATLAB to do this function.
any help??
regards
Back to top
Google
AdSense
Google Adsense




Post02 Jul 2008 15:32   

Ads







Sorry, but you need login in to view this attachment

Back to top
Eugen_E



Joined: 29 Nov 2004
Posts: 358
Helped: 31


Post02 Jul 2008 15:54   

matlab+input+sound card+signal+scope


Take a period measurement, T, and about 20 visual measurements of amplitude, enter them in Matlab and use the interp function to generate a few hundred points. Then use fft, fftshift, abs to get the spectrum. The "sampling" frequency will be 20/T. Generate a frequency scale from -10/T to 10/T, and plot the spectrum.

It is very distorted, if you're looking for pure sine it's very far from that and the circuit should be checked to see what generates the nonlinearity. It seems like a B-E breakdown from a transistor or something similar. When it will look more like sin the measurement makes sense. A THD<5% is not visualy observable in the time domain.
Back to top
engineer



Joined: 09 Apr 2005
Posts: 62
Helped: 1


Post03 Jul 2008 23:11   

matlab+spectrum of signals


thanks Eugen for your reply
I just want to decompose this waveform to its fundamental and harmonics components so that I can know the THD of the nonlinear loads I am using
is there another way?
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 566


Post04 Jul 2008 1:35   

matlab voltage spectrum


Do you have some convenient way to transfer that waveform into MATLAB? If it's a digital scope, it should have some sort of data I/O port. It would be tedious and somewhat inaccurate to read points with your eye.

If your scope is analog, maybe you can use your computer's sound card as a digital oscilloscope. It's limited to audio frequency range, but that may be sufficient. MATLAB can input a waveform from a sound card. Modern sound cards have 16-bit converters, which give a nice spectrum.

If that's a high-voltage signal, be careful! Attenuate is to a safe level before feeding it into your computer.

To simply the MATLAB processing, try to pick equally spaced points along the time axis that includes exactly one waveform cycle. For example, if that's a 60 Hz waveform, you could collect 50 points spaced 1/3000 seconds. Then you could feed the points directly into an FFT without having to worry about applying a weighting function. Weighting functions work fine if your data includes many waveform cycles (like from your sound card), but not if it's only one cycle (you scope snapshot).
Back to top
engineer



Joined: 09 Apr 2005
Posts: 62
Helped: 1


Post04 Jul 2008 8:41   

spectrum analyzer and cro


thanks echo47 for your reply
I am working on an analog CRO and a high voltage signal so I can't use the sound card as I think the signal would be distorted from its original waveform if I tried to attenuate it to a low signal
how can I collect the sampling points you are talking about?
Back to top
echo47



Joined: 07 Apr 2002
Posts: 4206
Helped: 566


Post05 Jul 2008 5:15   

matlab, spectrum analyzer


A properly built attenuator shouldn't distort the signal. For example, your oscilloscope has a good input attenuator. However, if the voltage is quite high and if you are inexperienced, please don't try to build an attenuator due to the safety hazard.

Another idea -- some scopes have a "vertical out" or "CH1 out" connector on the back panel. It's a low-voltage version of the signal you seen on the CRT. That signal may be suitable for direct connection to a sound card.

If you don't have that option, then your only choice may be to tediously read points from the oscilloscope screen. The results may be mediocre due to the obvious measurement inaccuracies. A frequency transform is very sensitive to distorted data.

Or maybe someone has a program that can digitize the green waveform in your JPEG snapshot. I haven't seen such a thing, but it may exist.
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5154
Helped: 766
Location: Bochum, Germany


Post05 Jul 2008 5:33   

sound card cro


Apart from the discussed options, THD can be measured with a RMS meter after filtering the fundamental with a bandstop. This has been the standard method for decades. This is rather easy for a several 10 % THD as in the shown case.
Back to top
kender



Joined: 19 Jun 2005
Posts: 1231
Helped: 88
Location: Stanford, SF Bay Peninsula, California, Earth, Solar System, Milky Way


Post05 Jul 2008 5:50   

spectrum analyzer matlab


echo47 wrote:
Or maybe someone has a program that can digitize the green waveform in your JPEG snapshot. I haven't seen such a thing, but it may exist.

I've seen a program like that a couple of years ago. It was a free or OpenSource program. Unfortunately, I don't remember the name or the maker.
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Software Problems, Hints and Reviews -> CRO + MATLAB = Spectrum analyzer ?
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
spectrum analyzer using matlab and RS232 (1)
frequency analyzer or spectrum analyzer troubleshotting (5)
PC spectrum analyzer (4)
spectrum analyzer (7)
spectrum analyzer (3)
Spectrum Analyzer (1)
spectrum analyzer (3)
spectrum analyzer prices? (14)
Spectrum Analyzer Measurement (4)
RBW of spectrum analyzer q? (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS