For the front of the ECE 209 (Circuits and Electronics Laboratory) final exam I'm giving this Tuesday...
Personal weblog of Ted Pavlic. Includes lots of MATLAB and LaTeX (computer typesetting) tips along with commentary on all things engineering and some things not. An endless effort to keep it on the simplex.
Thursday, November 27, 2008
For the front of my 209 final exam...
Labels:
209,
analog electronics,
circuits,
ECE,
electronics,
final exam,
funny,
humor,
xkcd
Thursday, October 16, 2008
Fixing bug in hyperref's autoref: amsmath-type equations under items get "item" label
Earlier this year, in a comp.text.tex posting, I discussed a bug I found in hyperref. That bug was then fixed in hyperref 6.77a, but there are still plenty of old packages hanging around that have this bug (for example, the hyperref from TeXLive 2007 on my system that I still haven't upgraded to TeXLive 2008).
The problem happens when
To fix this problem, I use these lines of code just after I load hyperref in my preamble:
That fix changes all of the improper "item" labels back into proper "Equation" labels.
The problem happens when
- amsmath (or mathtools) is loaded.
- An equation (or any other type of displayed-math environment) environment with labels occurs INSIDE an enumerated item.
- You try to use \autoref to generate a reference to one of those equation labels later.
To fix this problem, I use these lines of code just after I load hyperref in my preamble:
The \AMShreffix (i.e., AMS-href-fix) macro "fixes" the displayed-math environment that you pass it. This example fixes equation, align, and gather. If you want to fix alignat too, add a \AMShreffix{alignat} at the end of those lines. Make similar changes for your other displayed-math environments (e.g., flalign and multline too).\makeatletter
\newcommand{\AMShreffix}[1]{%
\expandafter\let\csname old#1\expandafter\endcsname%
\csname #1\endcsname%
\expandafter\renewcommand\csname #1\endcsname{%
\@hyper@itemfalse\csname old#1\endcsname}}
\makeatother
\AMShreffix{equation}
\AMShreffix{align}
\AMShreffix{gather}
That fix changes all of the improper "item" labels back into proper "Equation" labels.
Monday, October 06, 2008
Big bug in the bathroom
A very large bug was spotted in the men's restroom...Check out how huge those mandibles are! That thing could take out an eyeball!For scale, I got this shot of it next to my shoe. The bug is about an inch long.I didn't step on the bug, but after I noticed it, someone else did. That didn't kill the bug, but it made it less mobile. I couldn't get a shot of it near my shoe when it was more mobile because it kept walking toward my shoe, and I was afraid it would eat through my shoe and eventually eat through me...
Labels:
insects
Officemate's bee research on NPR
The graduate school research of my officemate (Kevin Schultz) was featured on NPR All Things Considered on Saturday during the "Science out of the Box" segment:
"Bees Follow Their Leaders"
Professor Passino is our shared adviser, but my research has nothing to do with bee swarms. :) Professor Seeley is a collaborator of Passino/Schultz; he's from Cornell.
"Bees Follow Their Leaders"
When a swarm of bees takes flight, it can form a cloud as big as a school bus. But who's driving? And how do they know which way to go? Professor Thomas Seeley of Cornell University talks about how swarms of honeybees decide who's at the wheel and who's a backseat flier.The audio story is streamable from the NPR link.
Professor Passino is our shared adviser, but my research has nothing to do with bee swarms. :) Professor Seeley is a collaborator of Passino/Schultz; he's from Cornell.
Labels:
bees,
biology,
honeybees,
insects,
Kevin Passino,
Kevin Schultz,
research,
Thomas Seeley,
tracking
Saturday, October 04, 2008
Terra-Fi/Tera-Fi was my idea!
Someday they'll come out with terabit/s wireless networking (similar to 802.11... maybe 802.11t or something), and they'll need a name for it. It came to me this week that a great name would be "TeraFi" (or "TerraFi" or "Tera-Fi" or a similar spelling). That is, combine "terabit" and "wi-fi" to make a word that sounds like "terrify."
So that's my idea.
I wanted to put it out there before someone else did.
Tera-Fi. It's so fast it's scary.
So that's my idea.
I wanted to put it out there before someone else did.
Tera-Fi. It's so fast it's scary.
Labels:
computers,
hardware,
networking,
standards,
tera-fi,
terafi,
terra-fi,
terrafi,
wi-fi,
wireless networking
Monday, September 29, 2008
My Brother Kenny on YouTube
A YouTube video of my brother Kenny and his family is now available. It is an interview segment with them for the MDA telethon held on Labor Day. My brother has ALS, which is also known as "Lou Gehrig's disease."
The MDA is one of many organizations fighting this disease, and yet the general public knows very little about it and researchers are having a hard time getting positive results from animal models to perform equally as well in human tests.
PLEASE help support my brother and ALS research in general by donating to my d'Feet ALS walk page.
The MDA is one of many organizations fighting this disease, and yet the general public knows very little about it and researchers are having a hard time getting positive results from animal models to perform equally as well in human tests.
PLEASE help support my brother and ALS research in general by donating to my d'Feet ALS walk page.
Labels:
ALS,
Ken Timmons,
Kenny Timmons,
Lou Gehrig's disease,
MDA,
video,
YouTube
Friday, September 26, 2008
Ben Folds and Regina Spektor together
Today's NPR Song of the Day: Ben Folds: Cynicism Meets Sweetness
It's a good track. It's funny. It's witty. It's catchy. Oh, and its got some bitter realism mixed in there. Speaking of mixing, it's interesting combining Spektor and Folds. You can stream the track at the NPR page. The music video is embedded below...The explicit lyrics go something like... (where Spektor's lyrics are in parentheses)
- Song: "You Don't Know Me"
- Artist: Ben Folds (featuring Regina Spektor)
- CD: Way to Normal
- Genre: Pop-Rock
I wanna ask you —What?
Do you ever sit and wonder,
It's so strange
That we could be together for
So long, and never know, never care
What goes on in the other one's head?
Things I've felt but I've never said
You said things that I never said
So I'll say something that I should have said long ago:
(You don't know me)
You don't know me at all
(You don't know me)
You don't know me at all (at all)
You could have just propped me up on the table like a mannequin
Or a cardboard stand-up and paint me (paint me)
Any face that you wanted me
To be seen.
We're
Damned by the existential moment where
We saw the couple in the coma and
It was we were the cliché,
But we carried on anyway.
So, sure, I could just close my eyes.
Yeah, sure, trace and memorize,
But can you go back once you know
(You don't know me)
You don't know me at all
(You don't know me)
You don't know me at all (at all)
(You don't know me)
You don't know me at all
(You don't know me)
You don't know me
If I'm the person that you think I am (Ah ah ahh)
Clueless chump you seem to think I am (Ah ah ahhh)
So easily led astray,
An errant dog who occasionally escapes and needs a shorter leash, then
Why the fuck would you want me back?!
Maybe it's because
(You don't know me at all)
Ahhh ah
Ahhh ah
(You don't know me,
you don't know me.)
Ahhh ah
Ahhh ah
So, what I'm trying to say is
What (What?)
I'm trying to tell you
It's not gonna come out like I wanna say it cause I know you'll only change it.
(Say it.)
(You don't know me)
You don't know me at all
(You don't know me)
You don't know me at all (at all)
(You don't know me)
You don't know me at all
(You don't know me)
You don't know me at all (at all)
What?
(Mmmm, ohh oh
Ah ah ah ah ah
Aha ah ah ah
Ah-ah-ah-ah-ah
Oh-oh-oh-oh-oh
Aha ah
Ah ah
Ah-ah-ah-ah-ah-ah-ah-ah-ah
Oh-oh-oh-oh oh ohh)
Labels:
Ben Folds,
entertainment,
music,
NPR,
Regina Spektor,
song of the day,
songs
Tuesday, September 23, 2008
Fixing natbib: Adding tie between author and citation
Something that bugs me about natbib is that \citet puts a formal SPACE between the authors and the citation list, and so LaTeX like...
The best solution is to fix natbib so that this character is configurable. That would really help when using superscript references because you could get rid of the character all together (right now superscripts get a space before them, and that looks a little silly (especially when superscripts show up on the next line!)). However, that could take a while to get fixed (CTAN isn't quite SourceForge)... So I put together the following fix, which should work OK for \citet, \citet*, \Citet, and \Citet* regardless of how many optional arguments (0, 1, or 2) are present.
(note: the \makeatletter and \makeatother commands are not needed if these lines are put into a .sty file or in a natbib.cfg file (in the same directory as your TeX document source).
UPDATE: For author-year citations (i.e., "Harvard style citations"), you must replace the \citep with \citeyearpar. That is, replace the final section of the code above with this section:
. . . as discussed by \citet{SK86}.that shows up near the end of a typeset line can turn intoNot only does this put a number at the beginning of a line, which is a typography no-no when you aren't starting a numerical item in a list, but it separates the citation list from its neighbors. If natbib would just us a TIE (~ in TeX) instead, then the "Krebs" in the example above would never get separated from the "[1]."as discussed by Stephens and Krebs
[1].
The best solution is to fix natbib so that this character is configurable. That would really help when using superscript references because you could get rid of the character all together (right now superscripts get a space before them, and that looks a little silly (especially when superscripts show up on the next line!)). However, that could take a while to get fixed (CTAN isn't quite SourceForge)... So I put together the following fix, which should work OK for \citet, \citet*, \Citet, and \Citet* regardless of how many optional arguments (0, 1, or 2) are present.
(note: the \makeatletter and \makeatother commands are not needed if these lines are put into a .sty file or in a natbib.cfg file (in the same directory as your TeX document source).
Even if this problem gets fixed within natbib, it still might serve as a good example of how to deal with TWO or more optional arguments in macros...% Unfortunately, natbib does not TIE textual
% references to their citations. So authors
% sometimes get separated from citations when
% they come at the end of the line. The following
% lines attempt to fix this problem.
%
% The lines below do the equivalent of . . .
%
% \renewcommand\citet[1]%
% {\citeauthor{#1}~\citep{#1}}
%
% but they handle the star and capitalization and
% optional argument cases too.
%
% (the \makeatletter and \makeatother are not needed if
% these lines are put into a .sty file or in a natbib.cfg
% file)
\makeatletter
%
%%% These lines test for star and number of arguments
%%% and call the workhorses below
%
% Test for star (mid-sentence and start-sentence forms)
\def\citet{\@ifstar{\citetstar}{\citetnostar}}
\def\Citet{\@ifstar{\Citetstar}{\Citetnostar}}
%
% No star found. Now test for argument count.
\def\citetnostar%
{\@ifnextchar[{\squarecitet}{\simplecitet}}
\def\squarecitet[#1]%
{\@ifnextchar[{\twocitet[#1]}{\onecitet[#1]}}
\def\Citetnostar%
{\@ifnextchar[{\squareCitet}{\simpleCitet}}
\def\squareCitet[#1]%
{\@ifnextchar[{\twoCitet[#1]}{\oneCitet[#1]}}
%
% Star found. Now test for argument count.
\def\citetstar%
{\@ifnextchar[{\squarecitetstar}{\simplecitetstar}}
\def\squarecitetstar[#1]%
{\@ifnextchar[{\twocitetstar[#1]}{\onecitetstar[#1]}}
\def\Citetstar%
{\@ifnextchar[{\squareCitetstar}{\simpleCitetstar}}
\def\squareCitetstar[#1]%
{\@ifnextchar[{\twoCitetstar[#1]}{\oneCitetstar[#1]}}
%
\makeatother
%
%%% The following actually do the \cite work
%
% The \citet cases (no arg, one arg, and two args)
\def\simplecitet#1%
{\citeauthor{#1}~\citep{#1}}
\def\onecitet[#1]#2%
{\citeauthor{#2}~\citep[#1]{#2}}
\def\twocitet[#1][#2]#3%
{\citeauthor{#3}~\citep[#1][#2]{#3}}
%
% The \citet* cases (no arg, one arg, and two args)
\def\simplecitetstar#1%
{\citeauthor*{#1}~\citep{#1}}
\def\onecitetstar[#1]#2%
{\citeauthor*{#2}~\citep[#1]{#2}}
\def\twocitetstar[#1][#2]#3%
{\citeauthor*{#3}~\citep[#1][#2]{#3}}
%
% The \Citet cases (no arg, one arg, and two args)
\def\simpleCitet#1%
{\Citeauthor{#1}~\citep{#1}}
\def\oneCitet[#1]#2%
{\Citeauthor{#2}~\citep[#1]{#2}}
\def\twoCitet[#1][#2]#3%
{\Citeauthor{#3}~\citep[#1][#2]{#3}}
%
% The \Citet* cases (no arg, one arg, and two args)
\def\simpleCitetstar#1%
{\Citeauthor*{#1}~\citep{#1}}
\def\oneCitetstar[#1]#2%
{\Citeauthor*{#2}~\citep[#1]{#2}}
\def\twoCitetstar[#1][#2]#3%
{\Citeauthor*{#3}~\citep[#1][#2]{#3}}
UPDATE: For author-year citations (i.e., "Harvard style citations"), you must replace the \citep with \citeyearpar. That is, replace the final section of the code above with this section:
Those lines seem to work for me.%%% The following actually do the \cite work
%
% The \citet cases (no arg, one arg, and two args)
\def\simplecitet#1%
{\citeauthor{#1}~\citeyearpar{#1}}
\def\onecitet[#1]#2%
{\citeauthor{#2}~\citeyearpar[#1]{#2}}
\def\twocitet[#1][#2]#3%
{\citeauthor{#3}~\citeyearpar[#1][#2]{#3}}
%
% The \citet* cases (no arg, one arg, and two args)
\def\simplecitetstar#1%
{\citeauthor*{#1}~\citeyearpar{#1}}
\def\onecitetstar[#1]#2%
{\citeauthor*{#2}~\citeyearpar[#1]{#2}}
\def\twocitetstar[#1][#2]#3%
{\citeauthor*{#3}~\citeyearpar[#1][#2]{#3}}
%
% The \Citet cases (no arg, one arg, and two args)
\def\simpleCitet#1%
{\Citeauthor{#1}~\citeyearpar{#1}}
\def\oneCitet[#1]#2%
{\Citeauthor{#2}~\citeyearpar[#1]{#2}}
\def\twoCitet[#1][#2]#3%
{\Citeauthor{#3}~\citeyearpar[#1][#2]{#3}}
%
% The \Citet* cases (no arg, one arg, and two args)
\def\simpleCitetstar#1%
{\Citeauthor*{#1}~\citeyearpar{#1}}
\def\oneCitetstar[#1]#2%
{\Citeauthor*{#2}~\citeyearpar[#1]{#2}}
\def\twoCitetstar[#1][#2]#3%
{\Citeauthor*{#3}~\citeyearpar[#1][#2]{#3}}
Labels:
bibliographies,
bibliography,
examples,
latex,
latex examples,
natbib,
references,
tex,
TeX/LaTeX,
texlatex,
typesetting,
writing
Friday, September 19, 2008
Pretty analog docs
Lately, I've noticed more hits on my website for documents that I put together for some classes that I've taught. So I decided to collect all the substantial ones and list them in one place. I figured I'd do the same here...
- Analog Electronics Information
- ECE327 — Electronic Devices and Circuits Laboratory I (I've included lots of information, documentation, and links on this course web page) Some example documents that I produced for the lab:
- Transistor Basics — Introduces bipolar (junction) transistors and gives schematics for several common circuits.
- Practical Integrators — Introduces the operational amplifier implementation of an integrator and discusses solutions to practical problems with the circuit.
- Linear Voltage Regulators — Introduces the Zener shunt regulator and several series pass-transistor regulators based on it. Also discusses practical uses of the LM317 integrated circuit bandgap reference.
- Voltage Regulators Lab Report Strategies — Gives more analytical details about shunt and series regulators used in the lab.
- LM317 Regulated DC Supply Quick Refrence — Quick reference on configuring an LM317 as a 10 VDC regulated supply (with basic capacitive bypassing).
- Bandgap Voltage Reference Example: LM317 — Explains how the temperature-independent bandgap reference circuit within the LM317 works.
- Transistor-Based Ramp Generator — Describes two ways to build a ramp generator using a PNP transistor configured as a current source.
- Current Sources and Ramp Generators — A more complete discussion of ramp generators and current sources. Includes (impractical) operational amplifier implementations as well.
- Transistor-Based Ramp Generator (Quick Reference) — Short description of two different transistor-based ramp generators.
- Single-Rail Level-Shifter Amplifiers — Describes several ways of building a level-shifter amplifier when only one power supply rail is available.
- Dual-Rail Level-Shifter Amplifiers — Describes several ways of building a level-shifter amplifier when only two power supply rails are available.
- Current Driver for (Infrared) LED — Describes four different ways of building a current driver for interfacing a low-power digital signal to an LED that requires a significant amount of current for operation.
- Output Filtering Laboratory Procedure — Describes level-shifter amplifier, Sallen-Key Butterworth low-pass filter, and a current driver for an 8 Ω speaker that uses a BJT push-pull Sziklai-based output stage. Also discusses other
- Choosing an Output for Maximum Power: Impedance Matching — Discusses why maximum power is delivered when a load impedance is matched to its source impedance.
- Digital-to-Analog Converter (DAC) Lecture Notes — Discusses several sampling, quantization, and modulation issues. Also includes figures explaining structure and function of R-2R ladder and "H" bridge.
- Part pinout quick references:
- Bipolar transistors, Diodes, and Electrolytic capacitors
- MOS switch, GP operational amplifier, CMOS inverter, 555 timer, and CMOS array
- Zener diodes, NPN bipolar transistors, LM317 regulator, and Electrolytic capacitors
- 741 and 351 operational amplifiers with specifications and 555 timer
- Open-collector voltage comparator, GP operational amplifier, JK flip-flop, MOS switch, Diodes, Bipolar transistors, and Electrolytic capacitors
- MOS switch, MOS-input operational amplifier, MOS inverter, JK flip-flop, Infrared LED, Infrared photosensor, and Bipolar transistors
- LM317 regulator, GP operational amplifier, Bipolar transistors, and Electrolytic capacitors
- ECE209 — Circuits and Electronics Laboratory
(I've included lots of information, documentation, and links on this course web page)
Some example documents that I produced for the lab:- Review of Circuits as LTI Systems — Brief overview of the mathematics and structures commonly encountered when analyzing linear circuits.
- Sources of Phase Shift — Uses simple low-pass and high-pass RC filters to show sources of phase shift in (electrical) LTI systems.
- Phase-Shifter Circuit — Describes and analyzes a simple all-pass filter phase-shifter circuit.
- Lissajous Figures — Describes the use and interpretation of input-to-output Lissajous figures for analysis of linear time-invariant (LTI) systems in the laboratory.
- Digital-to-Analog Converter (DAC) Lecture Notes — Discusses basic DAC circuit implementation issues. Includes descriptive figure of R-2R ladder.
- Part Pinouts — Gives descriptive part pinouts for several parts used in an introductory lab on analog electronics, including LM741, LM747, 1N914, 1N4148, 2N3904, 2N2222, and Electrolytic capacitors.
- ECE327 — Electronic Devices and Circuits Laboratory I (I've included lots of information, documentation, and links on this course web page) Some example documents that I produced for the lab:
- Control Systems Information
- ECE557 — Control, Signals, and Systems Laboratory (classical control lab)
(I've included lots of information, documentation, and links on this course web page)
- ECE557 — Control, Signals, and Systems Laboratory (classical control lab)
My attempt at a "public domain" license declaration
Many lawyers will tell you that it is impossible for an author to explicitly release a new work into the public domain, but many authors would like to do such a thing. Normally the advice is to acknowledge retaining the copyright and then explicitly grant permission for public use of the work for every possible use.
So here's my attempt (taken from something I had to put into the public domain today:
Yes, I realize I could just ask the civil law attorney in my family who handles this type of thing daily, but I'm afraid he'd just think I was being silly.
So here's my attempt (taken from something I had to put into the public domain today:
I think much of that is redundant. You probably don't need that second half linking to CC's explanation of public domain. You probably don't need the "No rights reserved" and "All rights granted" crap either. Anyway, for the moment, I don't think they're doing any harm.Copyright (c) YEARS by AUTHORS
No rights reserved. All rights granted.
This work is licensed to the public domain. All persons
are permitted to use, copy, modify, distribute, and
publicly perform or display this work without restriction.
To view a copy of this license, visit
http://creativecommons.org/licenses/publicdomain/
or send a letter to Creative Commons, 171 Second Street,
Suite 300, San Francisco, California, 94105, USA.
Yes, I realize I could just ask the civil law attorney in my family who handles this type of thing daily, but I'm afraid he'd just think I was being silly.
Labels:
copyright,
Creative Commons,
licenses,
licensing,
public domain,
publications,
writing
Subscribe to:
Posts (Atom)




