Skip to content

Instantly share code, notes, and snippets.

@arthurafarias
Created August 1, 2016 18:56
Show Gist options
  • Save arthurafarias/05059d1be475e5f96f733e0b8127b090 to your computer and use it in GitHub Desktop.
Save arthurafarias/05059d1be475e5f96f733e0b8127b090 to your computer and use it in GitHub Desktop.
clear; clc;
fs = 8000;
ws = 2*pi*fs;
fc = 600;
wc = 2*pi*fc;
N = 29;
T = 1/fs;
syms n_;
h = @(n,T) limit(1./(n_.*pi).*sin(wc.*n_.*T),n_,n);
b = @(i) h(i-(N-1)/2,T);
for i = 1:N
bi(i) = b(i);
bi_d(i) = double(bi(i));
fprintf('b_%d &= %s = %.04f\\\\\n', i, char(latex(simplify(bi(i)))), bi_d(i));
end
@arthurafarias
Copy link
Author

{-0.00383035667401370,-0.0155914880631440,-0.0257832895730377,-0.0318309886183791,-0.0315129094781571,-0.0233872320947160,-0.00711351953745401,0.0163938607180578,0.0450158158078553,0.0756826728640657,0.104796987759965,0.128759053700121,0.144509664300617,0.150000000000000,0.144509664300617,0.128759053700121,0.104796987759965,0.0756826728640657,0.0450158158078553,0.0163938607180578,-0.00711351953745401,-0.0233872320947160,-0.0315129094781571,-0.0318309886183791,-0.0257832895730377,-0.0155914880631440,-0.00383035667401370,0.00702594030773904,0.0150052719359518}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment