Mudanças entre as edições de "Teste do highlight de códigos"

De MediaWiki do Campus São José
Ir para navegação Ir para pesquisar
(Criou página com '<syntaxhighlight lang="python" line='line'> def quick_sort(arr): less = [] pivot_list = [] more = [] if len(arr) <= 1: return arr else: pass </syntaxhighlight>')
 
 
(2 revisões intermediárias por 2 usuários não estão sendo mostradas)
Linha 1: Linha 1:
<syntaxhighlight lang="python" line='line'>
+
<syntaxhighlight lang=bash>
 +
$ cat /etc/passwd | grep home | wc -l
 +
</syntaxhighlight>
 +
 
 +
<syntaxhighlight lang=python>
 
def quick_sort(arr):
 
def quick_sort(arr):
 
less = []
 
less = []
Linha 7: Linha 11:
 
return arr
 
return arr
 
else:
 
else:
pass
+
pass  
 +
</syntaxhighlight>
 +
 
 +
<syntaxhighlight lang=matlab>
 +
%% Signal in Time Domain
 +
% Use Fourier transforms to find the frequency components of a signal buried in noise.
 +
% Specify the parameters of a signal with a sampling frequency of 1 kHz and a signal duration of 1.5 seconds
 +
Fs = 1000;            % Sampling frequency                   
 +
T = 1/Fs;            % Sampling period     
 +
L = 1500;            % Length of signal
 +
t = (0:L-1)*T;        % Time vector
 +
 
 +
% Form a signal containing a 50 Hz sinusoid of amplitude 0.7 and a 120 Hz sinusoid of amplitude 1.
 +
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
 +
 
 +
% Corrupt the signal with zero-mean white noise with a variance of 4.
 +
X = S + 2*randn(size(t));
 +
 
 +
% Plot the noisy signal in the time domain. It is difficult to identify the frequency components by looking at the signal X(t).
 +
subplot(311);
 +
plot(1000*t(1:200),X(1:200), 'b')
 +
title('Signal Corrupted with Zero-Mean Random Noise')
 +
xlabel('t (milliseconds)')
 +
ylabel('X(t)')
 +
hold on
 +
plot(1000*t(1:200),S(1:200),'r')
 +
hold off
 +
 
 
</syntaxhighlight>
 
</syntaxhighlight>

Edição atual tal como às 16h08min de 9 de março de 2020

$ cat /etc/passwd | grep home | wc -l
def quick_sort(arr):
	less = []
	pivot_list = []
	more = []
	if len(arr) <= 1:
		return arr
	else:
		pass
%% Signal in Time Domain 
% Use Fourier transforms to find the frequency components of a signal buried in noise.
% Specify the parameters of a signal with a sampling frequency of 1 kHz and a signal duration of 1.5 seconds
Fs = 1000;            % Sampling frequency                    
T = 1/Fs;             % Sampling period       
L = 1500;             % Length of signal
t = (0:L-1)*T;        % Time vector

% Form a signal containing a 50 Hz sinusoid of amplitude 0.7 and a 120 Hz sinusoid of amplitude 1.
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);

% Corrupt the signal with zero-mean white noise with a variance of 4.
X = S + 2*randn(size(t));

% Plot the noisy signal in the time domain. It is difficult to identify the frequency components by looking at the signal X(t).
subplot(311);
plot(1000*t(1:200),X(1:200), 'b')
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('t (milliseconds)')
ylabel('X(t)')
hold on
plot(1000*t(1:200),S(1:200),'r')
hold off