-
Notifications
You must be signed in to change notification settings - Fork 19
/
plot_spec_phs.m
49 lines (46 loc) · 1.4 KB
/
plot_spec_phs.m
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
function plot_spec_phs(f, a, d, w, h, type)
% 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.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if nargin < 6,
type = 'k--';
end;
nband = length(f)/2;
subplot(211)
for band = 1:nband,
idx = [band*2-1 band*2];
plot(f(idx), abs(a(band))+abs(d(band))*ones(1,2), sprintf('%s',type));
hold on;
plot(f(idx), abs(a(band))-abs(d(band))*ones(1,2), sprintf('%s',type));
end;
plot(w,abs(h));
subplot(212)
for band = 1:nband,
idx = [band*2-1 band*2];
if abs(a(band)) == 0
continue;
end
plot(f(idx), angle(a(band))+angle(d(band))*ones(1,2), sprintf('%s',type));
hold on;
plot(f(idx), angle(a(band))-angle(d(band))*ones(1,2), sprintf('%s',type));
end;
plot(w,angle(h));