Skip to content
Snippets Groups Projects
Commit 159dedf8 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Added subband spectrum subplot to zoom in on spurious levels in case of e.g....

Added subband spectrum subplot to zoom in on spurious levels in case of e.g. WG sinus as subband 64.
parent 06fdaaba
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,7 @@ tb.subband_wg = 1; % subband range 0:tb.nof_subbands-1, can be ...@@ -63,6 +63,7 @@ tb.subband_wg = 1; % subband range 0:tb.nof_subbands-1, can be
%tb.subband_wg = 12; %tb.subband_wg = 12;
tb.subband_wg = 301; tb.subband_wg = 301;
tb.subband_wg = 301+1/13; tb.subband_wg = 301+1/13;
tb.subband_wg = 64;
tb.phase = 0; % initial 'sinusoid' phase offset normalized to 2pi tb.phase = 0; % initial 'sinusoid' phase offset normalized to 2pi
tb.sop = 1; % initial 'impulse' start index in range ctrl_wg.block_size = tb.subband_fft_size tb.sop = 1; % initial 'impulse' start index in range ctrl_wg.block_size = tb.subband_fft_size
...@@ -423,7 +424,7 @@ xlabel(sprintf('Subbands 0:%d at time 0:%d [Tsub]', tb.nof_subbands-1, tb.nof_ts ...@@ -423,7 +424,7 @@ xlabel(sprintf('Subbands 0:%d at time 0:%d [Tsub]', tb.nof_subbands-1, tb.nof_ts
ylabel('Voltage'); ylabel('Voltage');
grid on; grid on;
%% Plot PFFT subbands spectrum and phase for all tb.nof_tsub in one plot %% Plot PFFT subbands spectrum in Volt and phase for all tb.nof_tsub in one plot
sub_ampl = abs(data_pfft_subband); sub_ampl = abs(data_pfft_subband);
sub_ampl_max = max(sub_ampl(:)); sub_ampl_max = max(sub_ampl(:));
sub_phase = angle(data_pfft_subband)*180/pi; sub_phase = angle(data_pfft_subband)*180/pi;
...@@ -434,7 +435,8 @@ fig=fig+1; ...@@ -434,7 +435,8 @@ fig=fig+1;
figure('position', [xfig+fig*dfig yfig-fig*dfig xfigw yfigw]); figure('position', [xfig+fig*dfig yfig-fig*dfig xfigw yfigw]);
figure(fig); figure(fig);
subplot(2,1,1); % Plot all Tsub full scale
subplot(3,1,1);
data = sub_ampl.'; data = sub_ampl.';
data = data(:); data = data(:);
plot(tsub_all, data, 'k', tsub_all(sub_I), data(sub_I), 'ko', tsub_all(sub_Iplus1), data(sub_Iplus1), 'kx'); plot(tsub_all, data, 'k', tsub_all(sub_I), data(sub_I), 'ko', tsub_all(sub_Iplus1), data(sub_Iplus1), 'kx');
...@@ -443,7 +445,20 @@ xlabel(sprintf('Subbands 0:%d at time 0:%d [Tsub]', tb.nof_subbands-1, tb.nof_ts ...@@ -443,7 +445,20 @@ xlabel(sprintf('Subbands 0:%d at time 0:%d [Tsub]', tb.nof_subbands-1, tb.nof_ts
ylabel('Voltage'); ylabel('Voltage');
grid on; grid on;
subplot(2,1,2); % Plot subrange of Tsub after impulse response at low level scale to zoom
% in on spurious levels, see also plot subband spectrogram
subplot(3,1,2);
data = sub_ampl.';
data = data(:);
plot(tsub_all, data, 'k', tsub_all(sub_I), data(sub_I), 'ko', tsub_all(sub_Iplus1), data(sub_Iplus1), 'kx');
xlim([19.9 23.1])
ylim([-0.001 0.005])
title(sprintf('Subband data - spurious levels (for WG subband = %6.3f)', tb.subband_wg));
xlabel(sprintf('Subbands 0:%d at time 0:%d [Tsub]', tb.nof_subbands-1, tb.nof_tsub-1));
ylabel('Voltage');
grid on;
subplot(3,1,3);
data = sub_phase.'; data = sub_phase.';
data = data(:); data = data(:);
plot(tsub_all, data, 'k', tsub_all(sub_I), data(sub_I), 'ko', tsub_all(sub_Iplus1), data(sub_Iplus1), 'kx'); plot(tsub_all, data, 'k', tsub_all(sub_I), data(sub_I), 'ko', tsub_all(sub_Iplus1), data(sub_Iplus1), 'kx');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment