why the conv(u,v,'same') choose the a vector a little right deviated to center position
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Tsung-Ju Yang
am 30 Mär. 2017
Kommentiert: Tsung-Ju Yang
am 31 Mär. 2017
For example
>> a=[1:10];
>> b=[7:7:28];
>> conv(a,b)
ans =
7 28 70 140 210 280 350 420 490 560 553 462 280
>>conv(a,b,'same')
ans =
70 140 210 280 350 420 490 560 553 462
The same option give a vector vector from element 70. Why not from element 28? Are there any math/enginerr reasons?
0 Kommentare
Akzeptierte Antwort
Greg Dionne
am 30 Mär. 2017
If b is of odd length, you will obtain what you expect.
For even length it will move to the next available point having the gap at the beginning, not at the end. To get the other way, try:
>> fliplr(conv(fliplr(a),fliplr(b),'same'))
ans =
28 70 140 210 280 350 420 490 560 553
3 Kommentare
Image Analyst
am 30 Mär. 2017
Basically it's shifted a half element to the side if you're using an even number of elements in your scanning kernel window instead of an odd number.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spectral Estimation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!