Prosenjit101
Newbie level 5
- Joined
- Apr 18, 2013
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Dhaka, Bangladesh
- Activity points
- 1,349
Here i have a code to downsample a given sequence.
in editor:
function[y]= dns(x)
k = input('Enter downsampling factor = ')
y= x(1:k:length(x));
end
in command window:
>> x = [ 1 2 3 4 5 6 7 8 9 10 11 12]
>> dns(x)
Enter downsampling factor = 3
k =
3
ans =
1 4 7 10
I need a similar type of code for upsampling.
in editor:
function[y]= dns(x)
k = input('Enter downsampling factor = ')
y= x(1:k:length(x));
end
in command window:
>> x = [ 1 2 3 4 5 6 7 8 9 10 11 12]
>> dns(x)
Enter downsampling factor = 3
k =
3
ans =
1 4 7 10
I need a similar type of code for upsampling.