From: <gnu...@us...> - 2009-03-16 07:16:54
|
Revision: 5611 http://octave.svn.sourceforge.net/octave/?rev=5611&view=rev Author: gnumuthu Date: 2009-03-16 07:16:40 +0000 (Mon, 16 Mar 2009) Log Message: ----------- sampled2continuous.m : new function that implements simple low-pass filter type reconstruction of uniformly sampled signals Modified Paths: -------------- trunk/octave-forge/main/signal/INDEX Added Paths: ----------- trunk/octave-forge/main/signal/inst/sampled2continuous.m Modified: trunk/octave-forge/main/signal/INDEX =================================================================== --- trunk/octave-forge/main/signal/INDEX 2009-03-13 09:33:49 UTC (rev 5610) +++ trunk/octave-forge/main/signal/INDEX 2009-03-16 07:16:40 UTC (rev 5611) @@ -172,4 +172,4 @@ wkeep wrev zerocrossing - + sampled2continuous Added: trunk/octave-forge/main/signal/inst/sampled2continuous.m =================================================================== --- trunk/octave-forge/main/signal/inst/sampled2continuous.m (rev 0) +++ trunk/octave-forge/main/signal/inst/sampled2continuous.m 2009-03-16 07:16:40 UTC (rev 5611) @@ -0,0 +1,43 @@ +%% Copyright (C) 2009 Muthiah Annamalai <mut...@gm...> +%% +%% This program is free software; you can redistribute it and/or +%% modify it under the terms of the GNU General Public License +%% as published by the Free Software Foundation; either version 2, +%% or (at your option) any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program; If not, see <http://www.gnu.org/licenses/>. + +## Usage: +## +## xt = sampled2continuous( xn , T, t ) +## +## Calculate the x(t) reconstructed +## from samples x[n] sampled at a rate 1/T samples +## per unit time. +## +## t is all the instants of time when you need x(t) +## from x[n]; this time is relative to x[0] and not +## an absolute time. +## +## This function can be used to calculate sampling rate +## effects on aliasing, actual signal reconstruction +## from discrete samples. +## +function xt = sampled2continuous( xn , T, t ) + if ( nargin < 3 ) + print_usage() + endif + + N = length( xn ); + xn = reshape( xn, N, 1 ); + [TT,tt]= meshgrid(T*(0:N-1)',t); + S = sinc((tt -TT)./T); + xt = S*xn; + return +end Property changes on: trunk/octave-forge/main/signal/inst/sampled2continuous.m ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |