Matlab - Widmo sygnału

0

Witam, mam problem z widmem sygnału z matlabie. Środek wykresu jest pusty. Ma ktoś pomysł co może być powodem?

title('U2');grid on;
xlabel('Czas [s]'); ylabel('Napiecie')


subplot(2,2,4)  
title('Widmo U2');grid on;
xlabel('Czestotliwosc'); ylabel('')

Wygląd wykresu:
http://i67.tinypic.com/2qk49cz.jpg

0

Do matlaba masz api, który można łatwo w pythonie skryptować i na pewno rozwiąże to twoje problemy, bo szybciej znajdzie przyczynę problemu, print to najlepszy debugger.

0

O ile dobrze pamiętam jeżeli używasz funkcji fft lub fftshift zwracane widmo aplitudowe jest dwustronne. Jednakże możliwym jest wyświetlenie widma jednostronnego poprzez odpowiednie rysowanie wykresu - skali x czyli naszej skali częstotliwości. Tu masz cytat, który Ci pomoże.

That code uses the fft so yes, it is the same thing.

The fft is a transform which gives you a complex result spanning negative and positive frequencies ( -nyquist to +nyquist ). The single-side spectrum throws away the negative frequencies which are often not required for things like plotting spectrum to obtain a single-side spectrum.

So the fft is the method used to transform from the time domain to the frequency domain, but its result requires some manipulation afterwards to obtain what is often the desired result, a single-sided power spectrum.

The code:

ff = Fs/2*linspace(0,1,NFFT/2+1);
is taking the positive half of the spectrum (NFFT/2 +1 gives this, including 0 and nyquist, hence the +1) and mapping it onto your real frequencies from 'normalised frequency'.

1 użytkowników online, w tym zalogowanych: 0, gości: 1