File:Frequency response of 3-term boxcar filter.svg
頁面內容不支援其他語言。
外觀
此 SVG 檔案的 PNG 預覽的大小:416 × 400 像素。 其他解析度:250 × 240 像素 | 499 × 480 像素 | 799 × 768 像素 | 1,065 × 1,024 像素 | 2,130 × 2,048 像素。
原始檔案 (SVG 檔案,表面大小:416 × 400 像素,檔案大小:20 KB)
摘要
描述Frequency response of 3-term boxcar filter.svg |
English: Frequency response (discrete time Fourier transform) of a 3-tap boxcar filter. To produce these plots, samples of the DTFT are obtained by computing the DFT of the zero-filled impulse response. Alternatively, one can directly sample the closed form of the DTFT: and plot the magnitude and angle of the samples. (See File:MA2Amp_C.svg) Note: At the two frequencies where the magnitude goes to zero, there are phase discontinuities of π radians. They are not artifacts of phase wrapping. Rather, they indicate a sign inversion... multiplication by -1. Since that is equivalent to an amplitude modification, it does not affect the filter's property of phase linearity. An illustration of that can be viewed at File:Amplitude & phase vs frequency for 3-term boxcar filter.svg. |
|||
日期 | ||||
來源 | 自己的作品 | |||
作者 |
original: Bob K vector version: Krishnavedala |
|||
授權許可 (重用此檔案) |
我,本作品的著作權持有者,決定用以下授權條款發佈本作品:
|
|||
其他版本 |
本檔案衍生自: Frequency response of 3-term boxcar filter.gif |
|||
SVG開發 InfoField | ||||
Python source InfoField | click to expand
This script is a translation of the original Octave script into Python, for the purpose of generating an SVG file to replace the GIF version. import scipy
from scipy import signal
import numpy as np
from matplotlib import pyplot as plt
plt.rcParams['svg.fonttype'] = 'none'
N = 256
h = np.array([1., 1., 1.]) / 3
H = scipy.fftpack.shift(scipy.fft(h, N), np.pi)
w = np.linspace(-N/2, N/2-1, num=N) * 2 * np.pi / N
fig = plt.figure(figsize=[5,5])
plt.subplot(211)
plt.plot(w, np.abs(H), 'blue')
plt.grid(True)
plt.ylabel('Magnitude')
plt.xlim([-np.pi,np.pi])
plt.xticks([-np.pi, -2*np.pi/3,0,2*np.pi/3,np.pi], [])
plt.subplot(212)
plt.plot(w, np.angle(H), 'blue')
plt.grid(True)
plt.ylabel('Phase (radians)')
plt.xlabel('$\\longleftarrow$ Frequency ($\\omega$) (radians/sample) $\\longrightarrow$')
plt.xticks([-np.pi, -2*np.pi/3,0,2*np.pi/3,np.pi], ['-$\pi$','-2$\pi$/3','0','2$\pi$/3','$\pi$'])
plt.xlim([-np.pi,np.pi])
plt.yticks([-np.pi, -2,-1,0,1,2,np.pi], ['-$\pi$','-2','-1','0','1','2','$\pi$'])
plt.ylim([-np.pi,np.pi])
plt.subplots_adjust(hspace=0.1)
plt.savefig('Frequency response of 3-term boxcar filter.svg', bbox_inches='tight', transparent=True)
|
|||
Octave/gnuplot source InfoField | click to expand
This script was derived from the original in order to address some GNUplot bugs: a missing title and two missing axis labels. And to add an Octave print function, which creates an SVG file. Alternatively, the gnuplot screen image has an export function that produces an SVG file, but the π characters aren't as professional-looking. I think the resultant quality produced by this script is now better than the file produced by the Python script.
graphics_toolkit gnuplot
clear all; close all; clc
hfig = figure("position",[100 100 509 509]);
x1 = .12; % left margin for name of Y-variable
x2 = .02; % right margin
y1 = .10; % bottom margin for ticks
y2 = .08; % top margin for title
dy = .08; % vertical space between rows
width = 1-x1-x2;
height= (1-y1-y2-dy)/2; % space allocated for each of 2 rows
x_origin = x1;
y_origin = 1; % start at top of graph area
%=======================================================
N= 256;
h = [1 1 1]/3; % impulse response
H = fftshift(fft(h,N)); % samples of DTFT
abscissa = (-N/2:N/2-1)*2*pi/N; % normalized frequency
%=======================================================
y_origin = y_origin -y2 -height; % position of top row
subplot("position",[x_origin y_origin width height])
plot(abscissa, abs(H), "linewidth",2);
xlim([-pi pi])
ylim([0 1.2])
set(gca, "XTick", [-pi -2*pi/3 0 2*pi/3 pi])
set(gca, "YTick", [0 .2 .4 .6 .8 1])
grid("on")
ylabel("Magnitude")
% set(gca, "ticklabelinterpreter", "tex") % tex is the default
set(gca, "XTickLabel", ['-\pi'; '-2\pi/3'; '0'; '2\pi/3'; '\pi';])
set(gca, "YTickLabel", ['0'; '.2'; '.4'; '.6'; '.8'; '1';])
title("Frequency response of 3-term boxcar filter", "fontsize", 12)
%=======================================================
y_origin = y_origin -dy -height;
subplot("position",[x_origin y_origin width height])
plot(abscissa, angle(H), "linewidth",2);
xlim([-pi pi])
ylim([-pi pi])
set(gca, "XTick", [-pi -2*pi/3 0 2*pi/3 pi])
set(gca, "YTick", [-pi -2 -1 0 1 2 pi])
grid("on")
xlabel('\leftarrow Frequency (\omega) (radians/sample) \rightarrow')
ylabel("Phase (radians)")
% set(gca, "ticklabelinterpreter", "tex") % tex is the default
set(gca, "XTickLabel", ['-\pi'; '-2\pi/3'; '0'; '2\pi/3'; '\pi';])
set(gca, "YTickLabel", ['-\pi'; '-2'; '-1'; '0'; '1'; '2'; '\pi';])
% The print function results in nicer-looking "pi" symbols
% than the export function on the GNUPlot figure toolbar.
print(hfig,"-dsvg", "-S509,509","-color", ...
'C:\Users\BobK\Frequency response of 3-term boxcar filter.svg')
|
在此檔案描寫的項目
描繪內容
22 8 2017
image/svg+xml
檔案歷史
點選日期/時間以檢視該時間的檔案版本。
日期/時間 | 縮圖 | 尺寸 | 使用者 | 備註 | |
---|---|---|---|---|---|
目前 | 2020年10月1日 (四) 13:07 | 416 × 400(20 KB) | Krishnavedala | Text-to-graph aspect ratio renders poorly in thumbnails with text unreadable. | |
2019年7月3日 (三) 01:36 | 512 × 512(37 KB) | Bob K | Increase graph "linewidth" to 2. | ||
2019年7月2日 (二) 22:11 | 512 × 512(37 KB) | Bob K | Enlarge image. Add title. Improve rendering of "pi" symbols. | ||
2017年8月22日 (二) 15:35 | 416 × 400(20 KB) | Krishnavedala | User created page with UploadWizard |
檔案用途
下列頁面有用到此檔案:
全域檔案使用狀況
以下其他 wiki 使用了這個檔案:
- en.wikipedia.org 的使用狀況
詮釋資料
此檔案中包含其他資訊,這些資訊可能是由數位相機或掃描器在建立或數位化過程中所新增的。若檔案自原始狀態已被修改,一些詳細資料可能無法完整反映出已修改的檔案。
寬度 | 333pt |
---|---|
高度 | 320pt |
隱藏分類: