\documentclass[11pt]{article}
\usepackage{palatino,graphicx}
%\pagestyle{empty}
\pagestyle{headings}
\input hdr_jmp

\topmargin=-0.5in
\textheight=9in
\evensidemargin 0.0in
\oddsidemargin 0.0in
\setlength{\textwidth}{6.5in}

\begin{document}
\ 
\hdr{1}

\begin{center}
{\Large\em EE469B:  Assignment 1} \\[0.15in]
{\em Due Thursday Oct. 3}
\end{center}

\paragraph{Introduction} This assignment concerns  typical Fourier transform designs of excitation pulses.  This includes designing windowed sinc pulses, calculating the RF amplitude required, simulating slice profiles, designing a pulse for a specific application, and computing the relative SAR of a pulse sequence. For simulating the slice profile, you will need two m-files that are available on the web site at
\begin{quote}
{\tt http://ee469b.stanford.edu/mfiles}
\end{quote}
After the homework is due, sample mfiles for the homework problems will also be available here.  Make sure your versions work, or download the sample solutions.  You will be depending on these for the rest of the class.

\paragraph{1. Design of Windowed Sinc RF Pulses} 
Write an m-file that computes a Hamming windowed sinc pulse, given a time-bandwidth product, and number of samples. 
\begin{verbatim}
>> rf = wsinc(timebandwidth, samples)
\end{verbatim}
Write the mfile so that it scales the waveform to sum to one, \verb+sum(rf) = 1+. Plot windowed sincs with TBW of 4, 8, and 12. The TBW=4 pulse is common for 180 degree pulses, the TBW of 8 is typical for excitation pulses, and a TBW of 12 or 16 is typical for slab select pulses.


\paragraph{2. Plot RF Amplitude}
 For convenience, we will assume that the RF waveforms  are normalized so that the sum of the RF waveform is the flip angle in radians.  The sampled RF waveform can then be thought of as a sequence of small flips. This eliminates the need to explicitly consider the pulse duration in the design and simulation. However, it is sometimes important to compute the RF pulse amplitude in Gauss.  In this problem you will write an m-file that takes a normalized RF pulse, and then, given a overall pulse length, scales the waveform to Gauss.

First, generate a 3.2 ms, $TBW = 8$ windowed sinc RF pulse, and scale it to a $\pi/2$ flip angle
\begin{verbatim}
>> rf = (pi/2)* wsinc(8,256);
\end{verbatim}
Then, write an m-file called \verb+rfscaleg+ that takes a normalized RF pulse and a pulse duration, and returns a waveform that is scaled to Gauss,
\begin{verbatim}
>> rfs = rfscaleg(rf, pulseduration);
\end{verbatim}
Plot the pulse you generated, scaled to Gauss.  Label the axes. What is the peak amplitude?

\paragraph{3.  Simulated Slice Profiles} 
An RF pulse simulation routine is provided in the m-file \verb+abrm.m+ on the web site.  This works by multiplying the sequence of rotations produced by the sampled RF waveform, using a spinor representation of the rotations.  We'll describe how this works in about two weeks.  The transverse magnetization it produces if given by
\begin{verbatim}
>> mxy = ab2ex(abrm(rf,x))
\end{verbatim}
where \verb+ab2ex.m+ is another m-file on the web page that converts the spinor solution to the transverse magnetization for an excitation pulse. The vector \verb+x+ contains the spatial positions for the samples of the profile that you would like to compute in ``resolution units'' (this would be one voxel if we were imaging).  Note that \verb+mxy+ is complex, and is \verb=mx+i*my=.

The width of a resolution unit $\Delta x$ is
\[
\Delta x = \frac{1}{2 k_{max}}
\]
where $\pm k_{max}$ is the extent of the pulse in excitation k-space, and the area under the slice select lobe is $2 k_{max}$.  Write an m-file that takes a gradient amplitude in G/cm and a pulse duration in ms, and converts the dimensionless \verb+x+ vector to true spatial position measured in cm,
\begin{verbatim}
>> xt = gt2cm(x,g,t);
\end{verbatim}
where \verb+g+ is the gradient strength in G/cm, and \verb+t+ is the time in ms.

Calculate the slice thickness of the $TBW=8$ pulse from problem 2, based on the relations presented in class.  Assume the slice select gradient is 0.6 G/cm. Simulate the RF pulse using \verb+ab2ex(abrm(rf,x))+, and plot the magnitude of the result
\begin{verbatim}
>> plot(gt2cm(x,0.6,3.2), abs(ab2ex(abrm(rf,x))));
\end{verbatim}
Choose \verb+x+ to show the interesting part of the plot, and label the axes.  Is the slice the expected width?

\paragraph{4. Design a Slab Select Pulse} 
You are designing a 3D gradient echo pulse sequence, and you need a slab select pulse in the $z$ dimension.  You have 6 ms for the pulse, and want it to be as sharp as possible.  You also have a peak RF amplitude constraint of 0.17 G.   
\begin{enumerate}
  \item [a) ]What is the highest time-bandwidth you can allow, given that the maximum flip angle will be 90 degrees?
  \item [b) ]Assume we want the minimum slab thickness to be 8 cm.  What is the gradient amplitude that this requires?
  \item [c) ]Simulate the slice profile. How wide is the transition band compared to the passband?  Assume that the passband edge is 95\% of the   middle of the passband, and the stopband edge is 5\% of the passband.
\end{enumerate}

%\newpage

\end{document}

\paragraph{5.  Compute the Relative SAR of a Pulse Sequence} 
A software model gives  the SAR limit  measured in terms of 1 ms rectangular 180 degree pulses (``hard'' 180's).  This depends on the patient weight, body part, and RF coil.   The limit might be 100 hard 180s per second, for example. The power of a particular RF pulse is 
\[
P = \int B_1^2(t)\  dt.
\]
The relative SAR of a particular RF pulse is it's power divided by the power in a 1 ms hard 180. The relative SAR of a pulse sequence is computed as the sum of the relative SAR's of each of the pulses, measured in equivalent hard 180's.

Write an mfile \verb+rsar.m+ which takes a normalized RF pulse and pulse duration, and returns the relative SAR, measured in equivalent hard 180's
\begin{verbatim}
>> eq180 = rsar(rf,t)
\end{verbatim}

Assume that you are developing an SSFP sequence.  The excitation pulse is a 1 ms TBW=2 windowed sinc. Assume you need a TR of 2.25 ms to do fat suppression with SSFP.  What is the maximum flip angle you can allow, given that the SAR limit is 100 equivalent 180's per second?

\end{document}

