Function to Produce Periodic Spike and Decay I am seeking a function (or short algorithm, ideally implemented in R) that produces something similar to the following:

See, I would like to be able to generate a vector of $n$ items that follows this sort of pattern, mapped to a set of inputs (say, seq(1:n)).  Ideally, I would be able to tell the algorithm to "spike" to a maximum height $h$ on every $k$th time period, and decay at rate $r$.  However, I would be sufficiently happy with simply being able to generate a spike pattern that occurs periodically.  
Also, I do know of the SGDR implementation (shown below), which is somewhat similar to what I am looking for.  However, I do not want the output to descend from the maximum height $h$ like a cosine function, I would like for it to descend like a decaying exponential.

 A: You describe an exponential decay, or "spike," as the basic ingredient in a periodic function $\tilde f.$  All other operations are affine transformations of this: shifting and scaling the argument and the value.
If we write the "spike" as a function $f$, and assume it decays rapidly in both directions, then its periodic version can be created by reducing mod $1:$
$$\tilde{f}(x) = f\left(x - \lfloor x \rfloor\right).$$
A flexible, simple, reliable--and therefore elegant and possibly even efficient--solution is to code these three ingredients separately: the spike function $f,$ this infinite sum (which of course will have to cut off at finite points), and the affine transformations.  Here are simple bare-bones R solutions.  spike computes the exponentially-decaying pulse described in the question:
cycle <- function(f) function(x) f(x - floor(x))
xform <- function(f, offset=0, rate=1, base=0, height=1) 
             function(x) base + height*f((x-offset)*rate)
spike <- function(x) (x >= 0) * exp(-x)

To illustrate, let's create a function that spikes at a rate of $1/4$ (that is, has a period of $4$, decays exponentially with a rate of $10,$ and attains heights just slightly greater than $2:$
f <- xform(cycle(xform(spike, rate=10)), height=2, rate=1/4)

Here is its graph on the interval $[-10,10]:$
curve(f(x), -10, 10, n=501)


My old workstation performs five million calculations of this particular $f$ per second: that's pretty efficient.
With this solution you have the ingredients to answer all questions like this one, regardless of the shape of the spikes.
A: Well, nobody decided to help a brother out.  However, I solved the problem on my own.  I am attaching the code and the resulting plot here, for anyone who is looking for this type of function in the future.  It may not be the most computationally efficient, but it gets the job done.
R code:
spikes_model <- function(maxiter, total_spikes = 10, max_height = 0.001, min_height = 0.000005, decay_rate = 1) {
  value_at_iteration <- rep(0, maxiter)
  spike_at <- maxiter / total_spikes
  current_rate <- min_height
  holder_timeval <- 0
  for(i in 1:maxiter) {
    spike_indicator <- i / spike_at
    if (is.integer(spike_indicator)) {
      current_rate <- max_height
      value_at_iteration[i] <- current_rate
      holder_timeval <- spike_indicator
    } else if (i < spike_at) {
      current_rate <- min_height
      value_at_iteration[i] <- current_rate
    } else {
      timeval <- i - (holder_timeval*spike_at)
      current_rate <- max_height*exp(-decay_rate*timeval) + min_height
      value_at_iteration[i] <- current_rate
    }
  }
  return(value_at_iteration)
}

asdf <- spikes_model(maxiter = 100)
plot(asdf, type="l")

The resulting beautiful plot:

