-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathplot_spec.m
More file actions
executable file
·63 lines (53 loc) · 1.8 KB
/
plot_spec.m
File metadata and controls
executable file
·63 lines (53 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
function plot_spec(f, a, d, name_array)
% PLOT_SPEC - Utility to plot frequency specifications
%
% plot_spec(f, a, d, type)
%
% f - frequency band edges
% a - band amplitudes
% d - band ripple specs
% type - line/plotting type (see S in 'help plot')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Spectral-Spatial RF Pulse Design for MRI and MRSI MATLAB Package
%
% Authors: Adam B. Kerr and Peder E. Z. Larson
%
% (c)2007-2011 Board of Trustees, Leland Stanford Junior University and
% The Regents of the University of California.
% All Rights Reserved.
%
% Please see the Copyright_Information and README files included with this
% package. All works derived from this package must be properly cited.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% modified by Hong Shang, July 2015, to display spec as well as name
type = 'k-';
type_lw = 1.7;
nband = length(f)/2;
if nargin == 3
for band = 1:nband,
idx = [band*2-1:band*2];
hp = plot(f(idx), a(idx)+d(band)*ones(1,2), sprintf('%s',type));
set(hp,'linewidth',type_lw);
hold on;
hp = plot(f(idx), a(idx)-d(band)*ones(1,2), sprintf('%s',type));
set(hp,'linewidth',type_lw);
end;
elseif nargin == 4
text_pos = 1;
for band = 1:nband,
idx = [band*2-1:band*2];
hp = plot(f(idx), a(idx)+d(band)*ones(1,2), sprintf('%s',type));
set(hp,'linewidth',type_lw);
hold on;
hp = plot(f(idx), a(idx)-d(band)*ones(1,2), sprintf('%s',type));
set(hp,'linewidth',type_lw);
text_pos = min([text_pos mean(a(idx))+d(band)]);
end
text_pos = text_pos + 0.1;
for band = 1:nband
idx = [band*2-1:band*2];
text(mean(f(idx)), text_pos, name_array{band}, 'FontSize',18, 'rotation',90);
end
end