File:Multirate upsampling (interpolation) filter.svg

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

Original file(SVG file, nominally 900 × 630 pixels, file size: 43 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Depiction of one dot product, resulting in one output sample (in green), computed by a multirate filter. This illustrates the formula at Upsampling by an integer factor, for the case L=4, n=9, j=3. Three (L-1) conceptual "inserted zeros" are depicted between each pair of input samples. Omitting them from the calculation is what distinguishes a multirate filter from a monorate filter.
Date
Source Own work
Author Bob K
Permission
(Reusing this file)
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

SVG development
InfoField
 
The source code of this SVG is invalid due to 5 errors.
 
This W3C-invalid vector image was created with LibreOffice.
Gnu Octave source
InfoField
click to expand

This graphic was created with the help of the following Octave script:

pkg load signal
graphics_toolkit gnuplot

 M = 1000;
 darkgreen = [33 150 33]/256;
 interpolation_factor = 4;

% Generate M+1 samples of a Gaussian window (filter type not important)
 filter = .3*exp(-.5*(((0:M)-M/2)/(.4*M/2)).^2);
% Sample the window.
 N=24;
 sam_per_hop = M/N;
 window_dots = filter(1+(0:N)*sam_per_hop);
 normalize   = sum(window_dots)/interpolation_factor;

 window_scale_factor = 0.5;
 sam_per_hop = sam_per_hop*window_scale_factor;
 
%------------------------------------------------------------------
 figure("position", [100 200 900 600])

% Plot the continuous filter function
 xoffset = sam_per_hop*15;
 yoffset = 0.1;
 
 plot(xoffset+(0:M)*window_scale_factor, yoffset+filter,  "linestyle",":", "linewidth",1, "color","black")
 set(gca, "xaxislocation", "origin")
 xlim([0 M])
 ylim([-.06 .45])                    % allows space for negative samples (in case I change the signal)
 set(gca, "ygrid","off");
 set(gca, "xgrid","on");
 set(gca, "ytick",[0], "fontsize",14);
 xticks = [0:4*sam_per_hop:M];
 set(gca, "xtick",xticks)
 set(gca,"xticklabel",[0:length(xticks)])

% Plot the filter coefficients
 hold on
 plot(xoffset+(0:N)*sam_per_hop, yoffset+window_dots,  "color","red", ".", "markersize",10)

% Create signal to be interpolated
 samples_per_cycle = 4*M;
 signal = .2*sin(2*pi*(0:M)/samples_per_cycle);

 signal_dots = signal(1:sam_per_hop:end);
% Simulate "inserted zeros", for display
 signal_dots(2:4:end) = 0;
 signal_dots(3:4:end) = 0;
 signal_dots(4:4:end) = 0;

% Plot the data
 L = length(signal_dots);
 plot((0:L-1)*sam_per_hop, signal_dots,  "color","blue", ".", "markersize",10)
 
% Compute dot product, and plot it
 dot_product = sum(window_dots(24:-4:4).*signal_dots(17:4:37))/normalize;
 x = 27*sam_per_hop;
 plot(x, dot_product, "color",darkgreen, ".", "markersize",14)
 plot([x,x],[0,.45]);                                   % vertical line
 
% xlabel('\leftarrow  n  \rightarrow', "fontsize",16)
 text(465, -.05, '\leftarrow  n  \rightarrow', "fontsize",16)
 text(18, .1, "X[n]", "fontsize",16, "color","blue")

 title("Multirate interpolation filter", "fontsize",16, "fontweight","normal");

File history

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

Date/TimeThumbnailDimensionsUserComment
current13:44, 24 December 2019Thumbnail for version as of 13:44, 24 December 2019900 × 630 (43 KB)Bob K (talk | contribs)add a vertical line for filter delay arrow to point at
15:12, 23 December 2019Thumbnail for version as of 15:12, 23 December 2019900 × 630 (43 KB)Bob K (talk | contribs)replace random noise with more realistic signal
15:54, 22 December 2019Thumbnail for version as of 15:54, 22 December 2019855 × 585 (41 KB)Bob K (talk | contribs)Label y-origin. Indicate filter delay.
14:43, 21 December 2019Thumbnail for version as of 14:43, 21 December 2019855 × 585 (36 KB)Bob K (talk | contribs)User created page with UploadWizard

The following page uses this file:

File usage on other wikis

The following other wikis use this file:

Metadata