%% Versuch

load VP01.mat

y = VP01(:,2);  % data

Fs = 1000; % Abtastfrequenz in Hz
nfft = length(y); % Anzahl Messwerte

[mag, mag_dB, fv] = FFT_betragsspektrum( y, nfft, Fs, 1, 0) ; % Funktionsaufruf

figure(1)
semilogx(fv,mag_dB,'b'); % doppelt-logarithmische Darstellung beider Achsen
title('Amplitudenspektrum')
xlabel('Frequenz [Hz]');
ylabel('Amplitude [dB]');
grid on;
ax = gca;
xticks = {'0.0001' '0.001' '0.01' '0.1' '1' '10' '100' '1000'};
set(ax,'XTickLabel',xticks)

figure(2)
plot(fv,mag_dB,'b'); % Logarithmische Skalierung der Y_Achse in dB
title('Amplitudenspektrum')
xlabel('Frequenz [Hz]');
ylabel('Amplitude [dB]');
grid on;

figure(3)
plot(fv,mag,'b'); % lineare Skalierung der Y_Achse
title('Amplitudenspektrum')
xlabel('Frequenz [Hz]');
ylabel('Amplitude');
grid on;