Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
f397e7fd
Commit
f397e7fd
authored
8 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Corrected title in subband phase plot. Use subplot for real() and imag() in subband plot.
parent
f9276a33
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/apertif/matlab/run_pfb_complex.m
+30
-3
30 additions, 3 deletions
applications/apertif/matlab/run_pfb_complex.m
applications/apertif/matlab/run_pfft_complex.m
+18
-6
18 additions, 6 deletions
applications/apertif/matlab/run_pfft_complex.m
with
48 additions
and
9 deletions
applications/apertif/matlab/run_pfb_complex.m
+
30
−
3
View file @
f397e7fd
...
@@ -48,7 +48,7 @@ tb.model_signal = 'phasor'; % Use phasor to check the frequency respo
...
@@ -48,7 +48,7 @@ tb.model_signal = 'phasor'; % Use phasor to check the frequency respo
tb
.
model_quantization
=
'floating point'
;
tb
.
model_quantization
=
'floating point'
;
tb
.
model_quantization
=
'fixed point'
;
tb
.
model_quantization
=
'fixed point'
;
tb
.
nof_channels
=
32
;
tb
.
nof_channels
=
64
;
% Carrier frequency
% Carrier frequency
tb
.
channel_wg
=
1
;
% channel range -tb.nof_channels/2:tb.nof_channels/2-1, can be fraction to have any sinusoid frequency
tb
.
channel_wg
=
1
;
% channel range -tb.nof_channels/2:tb.nof_channels/2-1, can be fraction to have any sinusoid frequency
...
@@ -60,7 +60,7 @@ tb.sop = 1; % initial 'impulse' start index in range ctr
...
@@ -60,7 +60,7 @@ tb.sop = 1; % initial 'impulse' start index in range ctr
% Model a frequency sweep of the 'sinusoid'
% Model a frequency sweep of the 'sinusoid'
tb
.
chirp
=
0
;
% 0 = use fixed tb.channel_wg frequency or pulse period equal to block_size
tb
.
chirp
=
0
;
% 0 = use fixed tb.channel_wg frequency or pulse period equal to block_size
%
tb.chirp = 1; % else increment WG frequency every block to have chirp frequency sweep or slide the pulse
tb
.
chirp
=
1
;
% else increment WG frequency every block to have chirp frequency sweep or slide the pulse
if
strcmp
(
tb
.
model_signal
,
'noise'
)
if
strcmp
(
tb
.
model_signal
,
'noise'
)
tb
.
nof_tchan
=
50
;
% number of channel periods to simulate, >> ctrl_pfir_channel.nof_taps
tb
.
nof_tchan
=
50
;
% number of channel periods to simulate, >> ctrl_pfir_channel.nof_taps
elseif
tb
.
chirp
elseif
tb
.
chirp
...
@@ -394,6 +394,31 @@ xlabel(sprintf('Time 0:%d [Tchan]', tb.nof_tchan-1));
...
@@ -394,6 +394,31 @@ xlabel(sprintf('Time 0:%d [Tchan]', tb.nof_tchan-1));
ylabel
(
'Voltage'
);
ylabel
(
'Voltage'
);
grid
on
;
grid
on
;
%% Plot PFFT channels real and imaginary for all tb.nof_tchan in one plot
data
=
data_pfft_channel
.'
;
data
=
data
(:);
hy
=
1.2
*
max
(
abs
(
data
));
fig
=
fig
+
1
;
figure
(
'position'
,
[
xfig
+
fig
*
dfig
yfig
-
fig
*
dfig
xfigw
yfigw
]);
figure
(
fig
);
subplot
(
2
,
1
,
1
);
plot
(
tchan_all
,
real
(
data
),
'k'
,
tchan_all
(
chan_I
),
real
(
data
(
chan_I
)),
'ko'
,
tchan_all
(
chan_Iplus1
),
real
(
data
(
chan_Iplus1
)),
'kx'
);
ylim
([
-
hy
hy
])
title
(
sprintf
(
'Channel real data (o,x = channel %d,%d for WG channel = %6.3f)'
,
tb
.
channel_i
,
tb
.
channel_iplus1
,
tb
.
channel_wg
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
ylabel
(
'Voltage'
);
grid
on
;
subplot
(
2
,
1
,
2
);
plot
(
tchan_all
,
imag
(
data
),
'k'
,
tchan_all
(
chan_I
),
imag
(
data
(
chan_I
)),
'ko'
,
tchan_all
(
chan_Iplus1
),
imag
(
data
(
chan_Iplus1
)),
'kx'
);
ylim
([
-
hy
hy
])
title
(
sprintf
(
'Channel imag data (o,x = channel %d,%d for WG channel = %6.3f)'
,
tb
.
channel_i
,
tb
.
channel_iplus1
,
tb
.
channel_wg
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
ylabel
(
'Voltage'
);
grid
on
;
%% Plot PFFT channels spectrum and phase for all tb.nof_tchan in one plot
%% Plot PFFT channels spectrum and phase for all tb.nof_tchan in one plot
chan_ampl
=
abs
(
data_pfft_channel
);
chan_ampl
=
abs
(
data_pfft_channel
);
chan_ampl_max
=
max
(
chan_ampl
(:));
chan_ampl_max
=
max
(
chan_ampl
(:));
...
@@ -404,6 +429,7 @@ chan_phase(x) = 0; % force phase of too small signals to 0
...
@@ -404,6 +429,7 @@ chan_phase(x) = 0; % force phase of too small signals to 0
fig
=
fig
+
1
;
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
);
subplot
(
2
,
1
,
1
);
data
=
chan_ampl
.'
;
data
=
chan_ampl
.'
;
data
=
data
(:);
data
=
data
(:);
...
@@ -412,12 +438,13 @@ title(sprintf('Channel data - amplitude (o,x = channel %d,%d for WG channel = %
...
@@ -412,12 +438,13 @@ title(sprintf('Channel data - amplitude (o,x = channel %d,%d for WG channel = %
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
ylabel
(
'Voltage'
);
ylabel
(
'Voltage'
);
grid
on
;
grid
on
;
subplot
(
2
,
1
,
2
);
subplot
(
2
,
1
,
2
);
data
=
chan_phase
.'
;
data
=
chan_phase
.'
;
data
=
data
(:);
data
=
data
(:);
plot
(
tchan_all
,
data
,
'k'
,
tchan_all
(
chan_I
),
data
(
chan_I
),
'ko'
,
tchan_all
(
chan_Iplus1
),
data
(
chan_Iplus1
),
'kx'
);
plot
(
tchan_all
,
data
,
'k'
,
tchan_all
(
chan_I
),
data
(
chan_I
),
'ko'
,
tchan_all
(
chan_Iplus1
),
data
(
chan_Iplus1
),
'kx'
);
ylim
([
-
180
180
])
ylim
([
-
180
180
])
title
(
sprintf
(
'Channel data -
amplitud
e (o,x = channel %d,%d for WG channel = %6.3f)'
,
tb
.
channel_i
,
tb
.
channel_iplus1
,
tb
.
channel_wg
));
title
(
sprintf
(
'Channel data -
phas
e (o,x = channel %d,%d for WG channel = %6.3f)'
,
tb
.
channel_i
,
tb
.
channel_iplus1
,
tb
.
channel_wg
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
ylabel
(
'Phase [degrees]'
);
ylabel
(
'Phase [degrees]'
);
grid
on
;
grid
on
;
...
...
This diff is collapsed.
Click to expand it.
applications/apertif/matlab/run_pfft_complex.m
+
18
−
6
View file @
f397e7fd
...
@@ -257,16 +257,26 @@ ylabel('Voltage');
...
@@ -257,16 +257,26 @@ ylabel('Voltage');
grid
on
;
grid
on
;
%% Plot PFFT channels real and imaginary for all tb.nof_tchan in one plot
%% Plot PFFT channels real and imaginary for all tb.nof_tchan in one plot
data
=
data_pfft_channel
.'
;
data
=
data
(:);
hy
=
1.2
*
max
(
abs
(
data
));
fig
=
fig
+
1
;
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
);
data
=
data_pfft_channel
.'
;
subplot
(
2
,
1
,
1
);
data
=
data
(:);
plot
(
tchan_all
,
real
(
data
),
'k'
,
tchan_all
(
chan_I
),
real
(
data
(
chan_I
)),
'ko'
,
tchan_all
(
chan_Iplus1
),
real
(
data
(
chan_Iplus1
)),
'kx'
);
hy
=
1.2
*
max
(
abs
(
data
));
plot
(
tchan_all
,
real
(
data
),
'r'
,
tchan_all
,
imag
(
data
),
'b'
);
ylim
([
-
hy
hy
])
ylim
([
-
hy
hy
])
title
(
sprintf
(
'Channel real and imag data (o,x = channel %d,%d for WG channel = %6.3f)'
,
tb
.
channel_i
,
tb
.
channel_iplus1
,
tb
.
channel_wg
));
title
(
sprintf
(
'Channel real data (o,x = channel %d,%d for WG channel = %6.3f)'
,
tb
.
channel_i
,
tb
.
channel_iplus1
,
tb
.
channel_wg
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
ylabel
(
'Voltage'
);
grid
on
;
subplot
(
2
,
1
,
2
);
plot
(
tchan_all
,
imag
(
data
),
'k'
,
tchan_all
(
chan_I
),
imag
(
data
(
chan_I
)),
'ko'
,
tchan_all
(
chan_Iplus1
),
imag
(
data
(
chan_Iplus1
)),
'kx'
);
ylim
([
-
hy
hy
])
title
(
sprintf
(
'Channel imag data (o,x = channel %d,%d for WG channel = %6.3f)'
,
tb
.
channel_i
,
tb
.
channel_iplus1
,
tb
.
channel_wg
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
ylabel
(
'Voltage'
);
ylabel
(
'Voltage'
);
grid
on
;
grid
on
;
...
@@ -281,6 +291,7 @@ chan_phase(x) = 0; % force phase of too small signals to 0
...
@@ -281,6 +291,7 @@ chan_phase(x) = 0; % force phase of too small signals to 0
fig
=
fig
+
1
;
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
);
subplot
(
2
,
1
,
1
);
data
=
chan_ampl
.'
;
data
=
chan_ampl
.'
;
data
=
data
(:);
data
=
data
(:);
...
@@ -289,12 +300,13 @@ title(sprintf('Channel data - amplitude (o,x = channel %d,%d for WG channel = %
...
@@ -289,12 +300,13 @@ title(sprintf('Channel data - amplitude (o,x = channel %d,%d for WG channel = %
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
ylabel
(
'Voltage'
);
ylabel
(
'Voltage'
);
grid
on
;
grid
on
;
subplot
(
2
,
1
,
2
);
subplot
(
2
,
1
,
2
);
data
=
chan_phase
.'
;
data
=
chan_phase
.'
;
data
=
data
(:);
data
=
data
(:);
plot
(
tchan_all
,
data
,
'k'
,
tchan_all
(
chan_I
),
data
(
chan_I
),
'ko'
,
tchan_all
(
chan_Iplus1
),
data
(
chan_Iplus1
),
'kx'
);
plot
(
tchan_all
,
data
,
'k'
,
tchan_all
(
chan_I
),
data
(
chan_I
),
'ko'
,
tchan_all
(
chan_Iplus1
),
data
(
chan_Iplus1
),
'kx'
);
ylim
([
-
180
180
])
ylim
([
-
180
180
])
title
(
sprintf
(
'Channel data -
amplitud
e (o,x = channel %d,%d for WG channel = %6.3f)'
,
tb
.
channel_i
,
tb
.
channel_iplus1
,
tb
.
channel_wg
));
title
(
sprintf
(
'Channel data -
phas
e (o,x = channel %d,%d for WG channel = %6.3f)'
,
tb
.
channel_i
,
tb
.
channel_iplus1
,
tb
.
channel_wg
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
xlabel
(
sprintf
(
'Channels 0:%d at time 0:%d [Tchan]'
,
tb
.
nof_channels
-
1
,
tb
.
nof_tchan
-
1
));
ylabel
(
'Phase [degrees]'
);
ylabel
(
'Phase [degrees]'
);
grid
on
;
grid
on
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment