Skip to content

Instantly share code, notes, and snippets.

@nhasbun
Created May 23, 2016 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhasbun/70fc11d6574bd5b1ea72844682bdbc35 to your computer and use it in GitHub Desktop.
Save nhasbun/70fc11d6574bd5b1ea72844682bdbc35 to your computer and use it in GitHub Desktop.
Single Side Band FFT for Matlab
function [resultado n]=fftsinglesideband(senal);
%% Funcion que retorna una FFT de Single Side
% ademas retorna n, la cantidad de puntos
% considerados para la FFT
% set de frecuencias se puede generar
% usando
% frecuencias =SAMPLING*(0:(n/2))/n;
L=length(senal);
n=2^nextpow2(L);
fftmoduladaFM1 =abs( fft(senal, n)/n );
fftsinglesideFM1 =fftmoduladaFM1(1:n/2+1);
fftsinglesideFM1(2:end-1) =2*fftsinglesideFM1(2:end-1);
resultado=fftsinglesideFM1;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment