File:Ram-Lak kernel.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 480 × 336 pixels, file size: 33 KB)

Captions

Captions

Plot of the Ram-Lak kernel, used for filtered backprojection image reconstruction.

Summary

[edit]
Description
English: Plot of the Ram-Lak kernel, used for filtered backprojection image reconstruction. Details: Azriel Rosenfeld, Avinash C. Kak (1982) Digital image processing and analysis
Date
Source Own work
Author Geek3
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Matplotlib source code

The plot was generated with Matplotlib
#! /usr/bin/env python3
# -*- coding:utf8 -*-

import matplotlib.pyplot as plt
import numpy as np
from math import *

def ramlak(N):
    y = np.zeros(N)
    y[0] = 0.25
    fodd = np.arange(1, N, 2)
    fodd = np.minimum(fodd, N - fodd)
    y[1:N:2] = (-1. / (pi * pi)) / (fodd * fodd)
    return y

N = 18
xlim = -8, 8
kernel = ramlak(N)

plt.figure(figsize=(5, 3.5))
plt.plot(np.arange(-N//2, N - N//2),
         np.roll(kernel, N//2),
         "o-", label="Ram-Lak")

xa = np.linspace(*xlim, 801)
ya = np.divide(-pi**-2, xa * xa, out=None, where=(xa!=0))
ya[xa==0] = float(nan)
plt.plot(xa, ya, "--", color="#bbbbbb", zorder=1.9, label=r"$-1/(x \pi)^2$")

annotate_args = {"va":"center", "ha":"left", "xytext":(12, 0), "zorder":1.8,
    "textcoords":"offset points", "fontsize":14,
    "bbox":{"fc":"white", "ec":"none"} }
plt.annotate(r"$\frac{1}{4}$", (0, kernel[0]), **annotate_args)
plt.annotate(r"$\frac{-1}{\pi^2}$", (1, kernel[1]), **annotate_args)
annotate_args.update({"va":"top", "ha":"center", "xytext":(0, -8)})
plt.annotate(r"$\frac{-1}{(3\pi)^2}$", (3, kernel[3]), **annotate_args)
plt.annotate(r"$\frac{-1}{(5\pi)^2}$", (5, kernel[5]), **annotate_args)
plt.annotate(r"$\frac{-1}{(7\pi)^2}$", (7, kernel[7]), **annotate_args)

plt.grid(True)
plt.xlim(*xlim)
plt.ylim(-0.13, 0.28)
plt.legend(loc="upper left", framealpha=1, borderaxespad=1.0, borderpad=0.6)
plt.tight_layout()
plt.savefig("Ram-Lak kernel.svg")

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current16:24, 10 September 2024Thumbnail for version as of 16:24, 10 September 2024480 × 336 (33 KB)Geek3 (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata